开发者

How to show OptionMenu() after cllongclick of any one listitems

I want to show the option menu on the longclick of any listitems as well as it should be shown automatically in开发者_如何学Python the case of multiple selection from the listview.


If I understand the question correctly, all you should have to do is set a listener and call the openOptionsMenu method.

getListView().setOnLongClickListener(new View.OnLongClickListener() {

    @Override
    public boolean onLongClick(View v) {
        YourActivity.this.openOptionsMenu();
        return true;
    }
});

You should familiarize yourself with the methods available to View and Activity.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜