标签:android style blog color sp on div log bs
listView.setOnCreateContextMenuListener(new OnCreateContextMenuListener() { public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { menu.add(0, 0, 0, "天天"); menu.add(0, 1, 0, "人人"); menu.getItem(0).setOnMenuItemClickListener( new OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem clickedItem) { Toast.makeText(BaseMap.this, "用户点击了菜单", 1500) .show(); return true; } }); menu.getItem(1).setOnMenuItemClickListener( new OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem clickedItem) { Toast.makeText(BaseMap.this, "用户点击了菜单", 1500) .show(); return true; } }); } });
这种情况下调用onContextItemSelected方法无事件响应,上面用法已验证可行。
标签:android style blog color sp on div log bs
原文地址:http://www.cnblogs.com/w-y-f/p/4118568.html