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 :: java restart program 
Java :: why are there no destructors in java? 
Java :: jpa default value enum 
Java :: how to import math lib in java 
Java :: calculator with java 
Java :: bytes to string solidity 
Java :: math library java 
Java :: if number is negative java 
Java :: range in java 
Java :: literals in java 
Java :: flow dependency android 
Java :: java scanner string to int 
Java :: Java make numbers 
Java :: java remove duplicates 
Java :: how to get data from combobox in java 
Java :: can strings be used in a 2 dimensional array in java 
Java :: java insert char in string at index 
Java :: how to print to the console in java 
Java :: java.math.biginteger cannot be cast to java.lang.long 
Java :: how to declare and insert value to arraylist in same line in java 
Java :: java date minus 1 day 
Java :: how to check the current user in firebase android 
Java :: get raondom from array java 
Java :: how to close a jframe in netbeans 
Java :: count occurrences of character in string java 8 
Java :: java string static arrat 
Java :: set source image in android studio 
Java :: java string to number 
Java :: test a javafx project 
Java :: bean factory vs application context 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =