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 Using range(e1, e2) Method 
Java :: Jax-RS PUT annotation 
Java :: java parse date with optional timezone 
Java :: Java Target annotations attributes 
Java :: jdbc code 
Java :: ratespiel java 
Java :: strings in java are represented as 
Java :: JAVA XML COURSE 
Java :: minecraft 21w14a bugs 
Java :: how to return list in java 
Java :: how to write 1,2,3,4.... in java 
Java :: what is serialization and deserialization in rest assured 
Java :: java initialise array in return 
Java :: Bukkit dev paid account 
Java :: hello world stack overflow 
Java :: The larger and the smaller of the character “E” and the integer 71 java 
Java :: how to configure multiple database in spring boot based for uat and dev environment 
Java :: access modifier overloaded method 
Java :: Java array with objects from different types 
Java :: java swing place objects vertically 
Java :: how to uncomment a block of statements in java 
Java :: compare time in java 
Java :: java optional parameters 
Java :: unicode in java 
Java :: java constructor 
Java :: convert python code to java 
Java :: java.lang.ClassNotFoundException: org.postgresql.Driver 
Java :: Leap year or not program in java using if-else 
Java :: print prime numbers in java 
Sql :: safe update mysql 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =