Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

show confirmation dialog java android

public void onDeleteClick(View v) {
    int i = Integer.parseInt((String)v.getTag());

    AlertDialog.Builder alert = new AlertDialog.Builder(AddressListActivity.this);
    alert.setTitle("Delete");
    alert.setMessage("Are you sure you want to delete?");
    alert.setPositiveButton("Yes", new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            Address address = _list.get(_currentPage*PANELS_PER_PAGE + i);
            _dbAdapter.deleteAddress(address.Id);

            _GetAddresses();

            dialog.dismiss();
        }
    });

    alert.setNegativeButton("No", new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
        }
    });

    alert.show();
}
Comment

PREVIOUS NEXT
Code Example
Java :: java how to center window 
Java :: java transform hashmap to list 
Java :: java print type of object 
Java :: create file android java specific folder 
Java :: How to efficiently find the first duplicate value in an array of ints between 1 and the n, with n being the size of the array? 
Java :: java write a file line by line 
Java :: java execute funtions at same time 
Java :: How to perform an iterative depth first search through a binary tree, in Java? 
Java :: spigot sounds 
Java :: java actionlistener 
Java :: kotlin android intent pass data 
Java :: how to set landscape in android studio 
Java :: input string a list in java 
Java :: add value with n variable with Arraylist in java 
Java :: java event enter key 
Java :: input date in java 
Java :: how to set the backtound color in java 
Java :: last day of month from localdate java 
Java :: get value textfield java 
Java :: string to enum java 
Java :: dupplicate classes android 
Java :: how to move from one activity to another in android studio on button click 
Java :: how to read a text file in java 
Java :: java hashmap for loop 
Java :: java string to path 
Java :: java import joptionpane 
Java :: system.out.print two dimensional array 
Java :: spring boot mongodb update subdocument 
Java :: java resource file 
Java :: how to write a json file using java 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =