Widget - Dialog CheckBox

private int checkedItem = 0;


new android.support.v7.app.AlertDialog.Builder(MainActivity.this).setTitle("Shape Type").setSingleChoiceItems(
new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }, checkedItem,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
checkedItem = which;
switch (which) {
case 0:
showMessage("0");
dialog.dismiss();
break;
case 1:
showMessage("1");
dialog.dismiss();
break;
case 2:
showMessage("2");
dialog.dismiss();
break;
case 3:
showMessage("3");
dialog.dismiss();
break;
default:
dialog.dismiss();
break;
}
}
}).show();

Komentar

Cara pembuatan Apps paling Populer

Create Stopwatch App in Android using Sketchware

TextInputLayout in Sketchware

How to find and​ highlight a word in a text field in Sketchware?

A Flash Light App in Sketchware

How to enable download in webview in Sketchware apps?

Intent - Open File By Type

Code for implementing Notifications in Sketchware

How to share an image from Drawable folder?

ActionBar back button

Animation Transtition Animation