I tried to solve it but I can not do anything, I always get the NPE even with the try and catch, I do not know what else to do, please some help,
what is the correct way to remove the npe? What should I put?
try{
if(user.isEmailVerified()){
Log.d(TAG, "onComplete: success. email is verified.");
Intent intent = new Intent(LoginActivity.this, HomeActivity.class);
startActivity(intent);
} else {
Toast.makeText(mContext, "Email is not verified \n check your email inbox.", Toast.LENGTH_SHORT).show();
mProgressbar.setVisibility(View.GONE);
mPleaseWait.setVisibility(View.GONE);
mAuth.signOut();
}
} catch (NullPointerException e){
Log.e(TAG, "onComplete: NullPointerException: " + e.getMessage() );
}
when I delete the progress bar the program is executed but then I get all this in the logcat...
02-18 21:03:17.670 1492-1492/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.togo.plgl.togo, PID: 1492
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.togo.plgl.togo/com.togo.plgl.togo.Home.HomeActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.enableAnimation(boolean)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2793)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2864)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1567)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.enableAnimation(boolean)' on a null object reference
at com.togo.plgl.togo.utils.BottomNavigationViewHelper.setupBottomNavigationView(BottomNavigationViewHelper.java:26)
at com.togo.plgl.togo.Home.HomeActivity.setupBottomNavigationView(HomeActivity.java:95)
at com.togo.plgl.togo.Home.HomeActivity.onCreate(HomeActivity.java:51)
at android.app.Activity.performCreate(Activity.java:6915)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2746)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2864)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1567)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
02-18 21:03:17.683 1492-1492/? I/Process: Sending signal. PID: 1492 SIG: 9