• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps how to unselect all my checkbox

goldE

Lurker
I'm trying without success to unselect all my checkbox picks

by pressing any button that in my java android program with this code

Code:
public void onListItemClick(ListView parent, View v, int position, long id)
 {
        parent.setItemChecked(position, parent.isItemChecked(position));
 }


 @Override
 protected  Dialog onCreateDialog(int id, Bundle args){
    switch(id){
    case 1:
        return new AlertDialog.Builder(this)
        .setIcon(R.drawable.ic_launcher)
        .setTitle("This is a dialog with some simple text...")
        .setPositiveButton("OK", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int whichButton)
            {
                Toast.makeText(getBaseContext(),"OK clicked!", Toast.LENGTH_SHORT).show();
            }})

        .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int whichButton)
            {
                Toast.makeText(getBaseContext(),"Cancel clicked!", Toast.LENGTH_SHORT).show();
            }
            })

        .setMultiChoiceItems(items, itemsChecked, new DialogInterface.OnMultiChoiceClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which, boolean isChecked) {
                Toast.makeText(getBaseContext(),items[which] + (isChecked ? " checked!":" unchecked!"),Toast.LENGTH_SHORT).show();
            }
            })
        .create();
        }
        return(null);
    }
how to select all and unselect all ?
 
Back
Top Bottom