Android Multi-Select Checkbox Issue [URGENT]
I will be honest I am pretty much getting very stressed over this Android
Issue
Please see the code below, I would be very very grateful for someone to
help me...
Basically it works, but does not show the Tick box when the user tabs on
the checkbox.... But when you scroll down and back up to the top on the
scroll the checkbox appears, but does not appear and disappear when user
tries to check it on the first time...
Please someone help!
Many thanks.
.........................................................................................
listener = new OnItemClickListener() {
public void onItemClick(AdapterView<?> av, View v, int position,
long id) {
// TODO Auto-generated method stub
// recent_pos=position;
if(currentdir.equals(root)){
index_back = getListView().getFirstVisiblePosition(); // set
//
last_visited_pos
// in
mStarStates[position] = !mStarStates[position]; // invert
// selection //
list
// view
index_grid = position; // set last_visited_pos in grid view
}
if (searchflag == true && searchlength > 0) {
String filepath = founditems[position];
File file = new File(filepath);
if (file.isDirectory()) {
OnclickOperation(filepath);
}
else {
OnclickOperation(filepath);
}
}
else {
if (multiselectflag) {
multiSelectData.clear();
int last_pos = position;
myGrid.setAdapter(new IconicGrid());
myGrid.setSelection(last_pos);
for (int i = 0; i < multiItems; i++) {
if (mStarStates[i]) {
multiSelectData.add(paths[i]);
} else {
multiSelectData.remove(paths[i]);
}
}
if (mStarStates[position]) {
multiSelectData.add(paths[position]); // add to
// multiselectdata
// if item
// is
// selected
} else if (!mStarStates[position]) {
multiSelectData.remove(paths[position]);
}
// fileInfo.setText(multiSelectData.size() +
// " items selected");
// find this
}
else {
String filepath = paths[position];
OnclickOperation(filepath);
}
}
}
};
No comments:
Post a Comment