First i am sorry for my bad English. :)
I must find out which item has been clicked on to add it in an ArrayList. If items are clicked successively, I want to add them successively in the ArrayList.
final ArrayList oldPostion = new ArrayList<Integer>();
ArrayAdapter adapterONE = new ArrayAdapter(this,android.R.layout.simple_list_item_activated_1, list);
ListView one = (ListView) findViewById(R.id.listViewOne);
one.setAdapter(adapterONE);
one.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
oldPostion.add(position);
int something = 0;
if(oldPostion != null && oldPostion.get(position - 1) != null){
if( oldPostion.get(position - 1) == position){
//do something like this
Toast.makeText(getApplicationContext(), "Item First Item" + "Selected Item" + one.getAdapter().getItem(position), Toast.LENGTH_LONG).show();
something = 1 + 1;
}else if(oldPostion.get(position) == position){
//do something like this
Toast.makeText(getApplicationContext(), "Item Second Item" + "Selected Item" + one.getAdapter().getItem(position) , Toast.LENGTH_LONG).show();
something = 1 - 1;
}
//Result
Toast.makeText(getApplicationContext(), Integer.toString(something), Toast.LENGTH_LONG).show();
}
}
}