java - Custom AlertDialog disappears on back button press -


hi guys have custom alert dialog created. in builder set cancelable false yet still disappears when press button, ideas?

this code dialog:

public final class hemispheredialogfragment extends dialogfragment { @override public dialog oncreatedialog(bundle savedinstancestate) {     // use builder class convenient dialog construction     alertdialog.builder builder = new alertdialog.builder(getactivity());     layoutinflater inflater = getactivity().getlayoutinflater();     view customtitle = inflater.inflate(r.layout.hemisphere_dialog_custom_title, null);     builder.setcustomtitle(customtitle);     string[] entries = new string[2];     entries[0] = getresources().getstring(r.string.northern_hemisphere);     entries[1] = getresources().getstring(r.string.southern_hemisphere);     builder.setitems(entries, new dialoginterface.onclicklistener() {         //the 'which' argument contains index position of selected item         public void onclick(dialoginterface dialog, int which) {             if( == 0 ) {                 globalvariables.getshared().setisinnorthernhemisphere(true);             } else if( == 1 ) {                 globalvariables.getshared().setisinnorthernhemisphere(false);             }              toolbaractivity.outfitsfragment.hemisphereselected();             globalvariables.getshared().sethasaskedforhemisphere(true);         }     });     builder.setcancelable(false);      //create alertdialog object , return     return builder.create(); } 

and how it's displayed:

new hemispheredialogfragment().show(getsupportfragmentmanager(), "hemispheredialog"); 

another small side question, there way change text size items in dialog?

you set alert dialog cancelable false, fragment still set cancelable, need add setcancelable(false) fragment well.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -