Long click on ListFragment

前端 未结 3 724
醉梦人生
醉梦人生 2021-02-05 01:44

I\'m working with a ListFragment and doing a onListItemClick. Everything works fine, but now I want to use a long Item Click (e.g setOnItemLongClickListener(new OnItemLongClickL

3条回答
  •  鱼传尺愫
    2021-02-05 02:16

    This works for me

    getListView().setOnItemLongClickListener(new OnItemLongClickListener() {
        public boolean onItemLongClick(AdapterView av, View v, int position, long id) {
            //Get your item here with the position                   
            return true;
        }
    });
    

提交回复
热议问题