Android : Alert Dialog with Multi Choice

前端 未结 3 1086
囚心锁ツ
囚心锁ツ 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:12

    Yes it's real

                new AlertDialog.Builder(Main.this)
                .setIcon(R.drawable.icon)
                .setTitle("Title")
                .setView(textEntryView)
                .setPositiveButton("Save", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {
                        //android.os.Debug.waitForDebugger();
    
    
                        /* User clicked OK so do some stuff */ 
                    }
                })
                .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {
    
                        /* User clicked cancel so do some stuff */
                    }
                })
                .setNeutralButton("Delete", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {
    
                    }
                })
                .create();
    

提交回复
热议问题