Android : Alert Dialog with Multi Choice

前端 未结 3 1119
囚心锁ツ
囚心锁ツ 2021-01-14 01:35

Is it possible to show Alert Dialog with Multi Choice with disabled items(Rows) in the list? By checking \"None\" Option in the list all options in the list should get disab

3条回答
  •  青春惊慌失措
    2021-01-14 02:06

    AlertDialog alertDialog  = new AlertDialog.Builder(context).create();   
                alertDialog.setTitle("Warning!");
                alertDialog.setMessage("Confirm closing activity without succes?");
                alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, "Yes", new DialogInterface.OnClickListener() {
    
    
                    public void onClick(DialogInterface dialog, int which) {
                        // TODO Auto-generated method stub
                        UpdateWebActivityState(ActivitiesEditActivity.this, serviceActivity.ActivityId,serviceActivity.WebActivityState , notes, sigBitmap);
                        isSuccessfullyClosed = false;
                        AlertDialog alert  = new AlertDialog.Builder(context).create(); 
                        alert.setTitle("Warning!");
                        alert.setMessage("Activity closed successfully");
                        alert.setButton(DialogInterface.BUTTON_POSITIVE, "Ok", new DialogInterface.OnClickListener() {
    
                            public void onClick(DialogInterface dialog, int which) {
                                // TODO Auto-generated method stub
    
                                do what you want here
                                finish();                   
                            }
    
                        });
    
                        alert.show();
    
                    }
                });
    
                alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, "No", new DialogInterface.OnClickListener() {
    
                    public void onClick(DialogInterface dialog, int which)
                    {
                            return;
                    }
                    });
    
                alertDialog.show();
    

提交回复
热议问题