NullPointerException when Using requestWindowFeature(Window.FEATURE_NO_TITLE) on ListActivity Extending Activity
- by ColorWP.com
I have a ListActivity extending class and I am trying to hide the default TitleBar (I think it's called ActionBar) using the code below. It works on a regular activity, but not on the ListActivity. How do I accomplish the same in this scenario?
public class MyClass extends ListActivity{
@Override
public void onCreate(Bundle b) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(b);
// Tried Window.FEATURE_NO_TITLE here as well
setContentView(R.layout.activity_myclass);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
}