Clicking 'Done' in notification settings causes app to crash [replication steps]
- Disable notifications in the app settings
- Swipe the app out of the recents screen
- Enable notifications in the app settings and click done
(better replication steps thanks to @recalculated)
I think this isn't any longer happening with the newest code because I can't reproduce it.
I am on the newest version (4.3.4) and I can still replicate it.
This is definitely fixed, but not pushed to play store yet.
Still occuring even with the latest Slide github code.
Are you sure you're compiling using the latest code?
If you're not logged in, it should show a message asking you to log in after clicking the Notification setting...
findViewById(R.id.notifications).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (Authentication.isLoggedIn) {
LayoutInflater inflater = getLayoutInflater();
// more stuff here
} else {
new AlertDialogWrapper.Builder(Settings.this)
.setTitle(R.string.general_login)
.setMessage(R.string.err_login)
.setPositiveButton(R.string.btn_yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
Intent inte = new Intent(Settings.this, Login.class);
Settings.this.startActivity(inte);
}
}).setNegativeButton(R.string.btn_no, new DialogInterface.OnClickLis{
public void onClick(DialogInterface dialog, int whichButton) {
finish();
}
}).show();
}
}
}
@karlding This bug is different, and occurs when the user is logged in. To clarify the reproduction steps:
- Disable notifications in the app settings
- Exit the app and swipe it out of the recents screen
- Enable notifications in the app settings and click done
Confirmed on my end
E/AndroidRuntime(30942): FATAL EXCEPTION: main
E/AndroidRuntime(30942): Process: me.ccrama.redditslide, PID: 30942
E/AndroidRuntime(30942): java.lang.NullPointerException: Attempt to invoke virtual method 'void me.ccrama.redditslide.Notifications.NotificationJobScheduler.cancel(android.content.Context)' on a null object reference
E/AndroidRuntime(30942): at me.ccrama.redditslide.Activities.Settings$6$4.onClick(Settings.java:198)
E/AndroidRuntime(30942): at android.view.View.performClick(View.java:4780)
E/AndroidRuntime(30942): at android.view.View$PerformClick.run(View.java:19866)
E/AndroidRuntime(30942): at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime(30942): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(30942): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(30942): at android.app.ActivityThread.main(ActivityThread.java:5254)
E/AndroidRuntime(30942): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(30942): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(30942): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
E/AndroidRuntime(30942): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)