[Solved] Error on start activity (NullPointerException) on Android Development


Line 46 is;

actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);

The only thing that can be null on here is actionBar, therefore getActionBar() is returning null, the reasons for this;

getActionBar() returns null – Title bar isn’t visible.

getActionBar returns null – You must request an action bar using getWindow().requestFeature(Window.FEATURE_ACTION_BAR);, you may think your info bar is an action bar.

etc.

You should be able to find your answer through the many other SO posts asking the same question.

2

solved Error on start activity (NullPointerException) on Android Development