Android: Context menu on single click

前端 未结 4 790
借酒劲吻你
借酒劲吻你 2020-12-28 14:51

I have an Intent that extends a ListActivity. In my onCreate method after having populated the list adapter I use registerForContextMenu(getListView());

4条回答
  •  心在旅途
    2020-12-28 15:55

    this work perfect....

        listmp3 = (ListView) findViewById(R.id.results_mp3);
        registerForContextMenu(listmp3);
    
        listmp3.setOnItemClickListener(new AdapterView.OnItemClickListener() {
    
            @Override
            public void onItemClick(AdapterView parent, View view, int position, long id) {
                listmp3.showContextMenuForChild(view);
            }
        });
    

提交回复
热议问题