I have an alert box for a log in and when ever the back button is pressed the alert box disappears. I've tried @Override public void onBackPressed() { // do nothing. }
@Override public void onBackPressed() { // do nothing. }
but it still just stops the back on the activity not the alertbox. Is there something special i have to do to disable the back button on the alertbox?
I believe setCancelable()
is intended for this...
http://developer.android.com/reference/android/app/AlertDialog.Builder.html#setCancelable(boolean )
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.