I have to hide a TextView on click on an item in a Listview
.
So my problem is that is when I click an item the toast generated is right while the view to hide is modified every 6 item.
list.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,int position, long id) {
String selected = ((TextView) view.findViewById(R.id.name)).getText().toString();
TextView selected_item = (TextView)view.findViewById(R.id.name);
selected_item.setVisibility(View.GONE);
Toast toast=Toast.makeText(getApplicationContext(), selected, Toast.LENGTH_SHORT);
toast.show();
}
});
here some screenshot:
before click:
after click:
How can i fix this? Thanks :)