How to access view items inside a ListView android?

Posted by Yasir Khan on Stack Overflow See other posts from Stack Overflow or by Yasir Khan
Published on 2012-10-20T10:49:01Z Indexed on 2012/10/20 11:00 UTC
Read the original article Hit count: 209

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about android

Related posts about android-listview