You need to use a Theme.AppCompat theme (or descendant) with this activity

前端 未结 30 4008
感动是毒
感动是毒 2020-11-21 04:42

Android Studio 0.4.5

Android documentation for creating custom dialog boxes: http://developer.android.com/guide/topics/ui/dialogs.html

If you want a custom d

30条回答
  •  误落风尘
    2020-11-21 05:08

    This is when you want a AlertDialog in a Fragment

                AlertDialog.Builder adb = new AlertDialog.Builder(getActivity());
                adb.setTitle("My alert Dialogue \n");
                adb.setPositiveButton("OK", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int which) {
    
                      //some code
    
                } });
                adb.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int which) {
    
                     dialog.dismiss();
    
                    } });
                adb.show();
    

提交回复
热议问题