Disabling the back button with an alertbox?
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() {
开发者_StackOverflow社区// 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)
精彩评论