Set long click listener for listview

后端 未结 5 519
心在旅途
心在旅途 2021-01-17 17:31

I have below codes:

public class MainActivity extends ListActivity { 
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceSt         


        
5条回答
  •  醉梦人生
    2021-01-17 18:09

    try this

    listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
    
            public boolean onItemLongClick(AdapterView arg0, View v,
                    int index, long arg3) {
    
                 // write your code
    
                return false;
            }}); 
    

提交回复
热议问题