Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

simple yes no dialog android default java

DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {
        switch (which){
        case DialogInterface.BUTTON_POSITIVE:
            //Yes button clicked
            break;

        case DialogInterface.BUTTON_NEGATIVE:
            //No button clicked
            break;
        }
    }
};

AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setMessage("Are you sure?").setPositiveButton("Yes", dialogClickListener)
    .setNegativeButton("No", dialogClickListener).show();
Comment

PREVIOUS NEXT
Code Example
Java :: java get random index from array 
Java :: junit 5 assert exception message 
Java :: gradle build with javadoc 
Java :: javafx live date and time 
Java :: joptionpane hello world 
Java :: removeAll hard code 
Java :: error:03000086 
Java :: java list addAll stream() filtereted 
Java :: java arraylist get number of elements with same parameter 
Java :: vector inline java 
Java :: java new string array 
Java :: turn off focus border java 
Java :: get sha key android 
Java :: how to print text in java 
Java :: how to check if page in webview or not in android studio 
Java :: binary string to int java 
Java :: int a=08 java 
Java :: list java processes 
Java :: actionlistener java 
Java :: button color xml android 
Java :: how to change color of radio button in android 
Java :: spigot sounds 
Java :: main method in java without static keyword 
Java :: input string a list in java 
Java :: circle line intersection java 
Java :: convert date to calendar java 
Java :: java pre increment 
Java :: anagram java program 
Java :: selet all elemnts 
Java :: how to use decimal format java 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =