Code example for SparseBooleanArray

Methods: put

0
		builder.setTitle("Add Members");
		builder.setIcon(R.drawable.add_group);
		builder.setMultiChoiceItems(R.array.friends, null, new OnMultiChoiceClickListener() {
			@Override 
			public void onClick(DialogInterface dialog, int which, boolean isChecked) {
				selectedMembers.put(which, isChecked);
			} 
		}); 
		builder.setPositiveButton("OK", new OnClickListener() {
			@Override 
			public void onClick(DialogInterface dialog, int which) {
 
				ArrayList<String> result = new ArrayList<String>();
				for( int i = 0; i < members.length; ++ i ){
					if( selectedMembers.get(i) ) 
						result.add(members[i]);
				} 
				mEventListener.onAddMembers(result);
			} 
		});