Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In the above code problem is the dialog will be create only once using onCreateDialog() if you clcik on the button first time. The Next time onwards just dialog will be open no changes are applied. So i am not recommended the onCreateDialog() for this case. Here i am creating the dialog for every button click and show it.</p> <pre><code>// Code: AlertDialog.Builder bookmark_dialog_obj; private OnClickListener bookmark_btnListener = new OnClickListener() { public void onClick(View v) { try { Bookmark_Dialog(RB_UpcomingRestaurantDetails.this); } catch(Exception ex2) { System.out.println("back btn error:"+ex2.toString()); } } public void Bookmark_Dialog(Context context) { System.out.println("onCreate Choice_Checked:"+Arrays.toString(choice_checked)); bookmark_dialog_obj = new AlertDialog.Builder(context); bookmark_dialog_obj.setTitle("Bookmarking for"); bookmark_dialog_obj.setMultiChoiceItems(choice, choice_checked, new OnMultiChoiceClickListener() { public void onClick(DialogInterface dialog, int index, boolean status) { } }); bookmark_dialog_obj.setPositiveButton("Ok", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { for(int i=0;i&lt;choice_checked.length;i++) { choice_checked_dynamic[i] = choice_checked[i]; } } }); bookmark_dialog_obj.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { for(int i=0;i&lt;choice_checked_dynamic.length;i++) { choice_checked[i] = choice_checked_dynamic[i]; } System.out.println("onCreate Cancel Choice_Checked:"+Arrays.toString(choice_checked)); } }); bookmark_dialog_obj.show(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload