Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Android Dialog

AlertDialog.Builder builder1 = new AlertDialog.Builder(context);
builder1.setMessage("Write your message here.");
builder1.setCancelable(true);

builder1.setPositiveButton(
    "Yes",
    new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int id) {
            dialog.cancel();
        }
    });

builder1.setNegativeButton(
    "No",
    new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int id) {
            dialog.cancel();
        }
    });

AlertDialog alert11 = builder1.create();
alert11.show();
Comment

android dialog box example

runOnUiThread(new Runnable() {
    @Override
    public void run() {

        if (!isFinishing()){
            new AlertDialog.Builder(YourActivity.this)
              .setTitle("Your Alert")
              .setMessage("Your Message")
              .setCancelable(false)
              .setPositiveButton("ok", new OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                      // Whatever...
                  }
              }).show();
        }
    }
});
Comment

android dialog modal

public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
	setCancelable(false);
}
Comment

PREVIOUS NEXT
Code Example
Java :: print anything in java 
Java :: lowercase string java 
Java :: spigot plugin send message 
Java :: android java how to blur an image 
Java :: what is static setter and getter examples in java 
Java :: this keyword java 
Java :: java check if string contains multiple words 
Java :: spring security logging 
Java :: java bfs 
Java :: android convert date to local timezone 
Java :: java object into list 
Java :: check if char is letter or digit 
Java :: android studio reg get float from numeric string 
Java :: jdbc dependency 
Java :: initializing list in java 
Java :: how to change resource color to int color in android 
Java :: jdialog middle of screen 
Java :: finding length of arrays in java 
Java :: how to convert character into operator 
Java :: java convert url/image to drawable 
Java :: give ram to java 
Java :: variables in java 
Java :: make quotation a string 
Java :: arraylist to primitive array 
Java :: getresources in adapter android 
Java :: android list newline 
Java :: java.lang.NoClassDefFoundError 
Java :: Pattern Programs in Java. 
Java :: arraylist replace 
Java :: localbroadcastmanager android example 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =