the problem is that i have two listView but one itemClick method, if i put a switch, the position on one list is the same than the other list... And by example if i want to open a popup on an item in one list, the item in the same position in the other list gonna do the same thing, and i really don't want, can you help me? Thanks
there is the code :
public void onItemClick(AdapterView parent, View v, int position, long id) { Object str = parent.getId(); if(str.equals(adapter_todo)){ switch(position){ case 0 : new AlertDialog.Builder(this).setTitle("test").setMessage("blah blah").setNeutralButton("close", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
}).show();
case 1 :
case 2 :
case 3 :
case 4 :
case 5 :
case 6 :
case 7 :
case 8 :
case 9 :
case 10 :
}
}
else if(str.equals(adapter_not_todo)){
switch(position){
case 0 : new AlertDialog.Builder(this).setTitle("test 2").setMessage("blah blah blah").setNeutralButton("close", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
}).show();
case 1 :
case 2 :
case 3 :
case 4 :
case 5 :
case 6 :
case 7 :
case 8 :
case 9 :
case 10 :
}
}