Note that there are some explanatory texts on larger screens.

plurals
  1. POCheck box in a dialog in Android
    primarykey
    data
    text
    <p>I am using google maps therefore when checking the checkbox some pictures will be added to the layer and the other check box will add different layer... when unchecking the first check box the picture related to it will be removed and also for the same will happen for the second check box.. Now the problem is that when checking the first check box the pics are added and then i do uncheck to the related check box the pics are not removed while the second check box is working fine ?? Help please </p> <p>I have a button that when I press it a dialog will be shown.. This dialog contains a check boxes. .<br> I defined the following variables in the class </p> <pre><code> CharSequence[] items = {"Layer1", "Layer2"}; boolean[] itemsChecked = new boolean[items.length]; </code></pre> <p>in the On create method I defined the following </p> <pre><code> Button AddLayers = (Button) findViewById(R.id.addlayers) ; AddLayers.setOnClickListener(this) ; </code></pre> <p>Then in the action </p> <pre><code>public void onClick(View v) { // TODO Auto-generated method stub showDialog(0); } @Override protected Dialog onCreateDialog(int id) { switch (id) { case 0: return new AlertDialog.Builder(this) //.setIcon(R.drawable.red_point) .setTitle("Add Layer") .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { SparseBooleanArray CheCked = ((AlertDialog) dialog).getListView().getCheckedItemPositions(); if (CheCked.get(0)) { ... mapOverlays.add(custom); } else { mapOverlays.remove(custom); } if (CheCked.get(1)) { ...... mapOverlays.add(custom2); } else { mapOverlays.remove(custom2) ; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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