-3

So, I am doing this project that includes an intro activity that switches to a menu activity with navigation drawer. Couple of days ago, I had an issue switching from intro to menu (Android Studio 1.0.2: java.lang.RuntimeException: Unable to start activity ComponentInfo: java.lang.NullPointerException) and it was solved by changing name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar" to name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar" thanks to goonerdroid's suggestion in my previous link.

The issue that I have now is that I am trying to add a search action on the top right corner of the action bar alongside the navigation drawer so it can search on different future activities and javas that I will be adding. When I run the program, it enters the intro activity with no problems. When I click on the button to take me to the menuactivity, it displays the following error:

07-21 07:00:53.450 2775-2775/com.plateformeressources E/AndroidRuntime: FATAL EXCEPTION: main
  Process: com.plateformeressources, PID: 2775
  java.lang.NullPointerException
    at com.plateformeressources.activity.LoginActivity$2.onClick(LoginActivity.java:87)
    at android.view.View.performClick(View.java:4438)
    at android.view.View$PerformClick.run(View.java:18422)
    at android.os.Handler.handleCallback(Handler.java:733)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:136)
    at android.app.ActivityThread.main(ActivityThread.java:5017)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
    at dalvik.system.NativeStart.main(Native Method)
just_user
  • 11,769
  • 19
  • 90
  • 135

1 Answers1

-1

in general, NullPointerException occures is when you try to use an object that has not been initialized with the new keyword or when you're trying to use empty string and do some thing with it.

Maher Nabil
  • 1,417
  • 1
  • 15
  • 19