Created
June 9, 2016 09:44
-
-
Save ninjayoto/74bdc6a19ed246e4f5f8f42d3a6bc3de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private AlertDialog showCustomDialog(final Activity act, | |
| CharSequence title, | |
| CharSequence message, | |
| CharSequence buttonYes, | |
| CharSequence buttonNo, | |
| final int selectedIndex) { | |
| AlertDialog.Builder customDialog = new AlertDialog.Builder(act); | |
| customDialog.setTitle(title); | |
| customDialog.setMessage(message); | |
| //clicking the positive button | |
| customDialog.setPositiveButton(buttonYes, new DialogInterface.OnClickListener() { | |
| public void onClick(DialogInterface dialogInterface, int i) { | |
| //Action performed on clicking the positive dialog button action | |
| picURL.remove(selectedIndex); | |
| } | |
| }); | |
| //Clicking the negative button | |
| customDialog.setNegativeButton(buttonNo, new DialogInterface.OnClickListener() { | |
| public void onClick(DialogInterface dialogInterface, int i) { | |
| //Action performed on clicking the negative dialog button action | |
| } | |
| }); | |
| return customDialog.show(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment