STEPS
1
IMPORT THE ALERTDIALOG CLASS TO YOUR ANDROID APPLICATION.import android.app.AlertDialog;
2
SET UP THE ALERTDIALOG CLASS TO THE BODY OF YOUR APPLICATION LIKE THIS. Set some properties for the AlertDialog object.AlertDialog alertDialog = new AlertDialog.Builder(this).create();
alertDialog.setTitle("Reset...");
alertDialog.setMessage("Are you sure?");
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// here you can add functions
alertDialog.setIcon(R.drawable.icon);
alertDialog.show();
3
SAVE YOUR APPLICATION AND RUN. You will get the image as below. VIDEO
No comments:
Post a Comment