How to access view items inside a ListView android?
- by Yasir Khan
I have ListView. i am successfully able to populate that ListView but what is want now is when user long press on ListItem it should make a button visible which i made invisible when i am populating ListView.
here is snippet i have tried.
mItemListView.setOnItemLongClickListener(new OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> adapterview, View arg1,
int arg2, long arg3) {
LinearLayout view=(LinearLayout) mItemListView.getChildAt(arg2);
view.getChildAt(0).setVisibility(View.VISIBLE);
return false;
}
});
My adapter is extending BaseAdapter