Getting this error even though have added all the activities in manifest. What to do?
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: FATAL EXCEPTION: main
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aaa.fyp/com.slidingmenu_tabhostviewpager.MainActivity}: java.lang.NullPointerException
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2372)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2424)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at android.app.ActivityThread.access$600(ActivityThread.java:169)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1388)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:107)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at android.os.Looper.loop(Looper.java:194)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5433)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:525)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:924)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:691)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: Caused by: java.lang.NullPointerException
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at com.slidingmenu_tabhostviewpager.MainActivity.onCreate(MainActivity.java:43)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at android.app.Activity.performCreate(Activity.java:5179)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2336)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2424)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at android.app.ActivityThread.access$600(ActivityThread.java:169)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1388)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:107)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at android.os.Looper.loop(Looper.java:194)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5433)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
11-23 15:37:55.465 24625-24625/com.aaa.fyp E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:525)
This is the class i have set as launcher activity:
public class MainActivity extends ActionBarActivity {
DrawerLayout drawerLayout;
RelativeLayout drawerPane;
ListView lvNav;
List<NavItem> listNavItems;
List<Fragment> listFragments;
ActionBarDrawerToggle actionBarDrawerToggle;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
}
Line 43 is:
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Manifest:
<activity
android:name="com.slidingmenu_tabhostviewpager.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>