why item.getMenuInfo() is null?

来源:互联网 发布:淘宝平台入驻协议 编辑:程序博客网 时间:2024/06/12 22:48

0down vote

getMenuInfo() will work on ListAdapter, not on views.

But, You can pass additional data with the tag of the view.

in getView: vi.setTag(position) activity.registerForContextMenu(vi);

declare in Activity private int id;

onCreateContextMenu: id = (int) v.getTag();

onContextItemSelected: you can use the id

shareimprove this answer
 
http://stackoverflow.com/questions/6190451/why-item-getmenuinfo-is-null




0 0
原创粉丝点击