1 2 3 4 | public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) { super .onCreateContextMenu(menu, view, menuInfo); new MenuInflater( this ).inflate(R.menu.context_mylibrary, menu); } |
1 2 3 4 | public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) { super .onCreateContextMenu(menu, view, menuInfo); new MenuInflater( this ).inflate(R.menu.context_mylibrary, menu); } |
1 2 3 4 5 6 7 8 9 10 | public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) { super .onCreateContextMenu(menu, view, menuInfo); AdapterContextMenuInfo info = (AdapterContextMenuInfo)menuInfo; ListView lv = (ListView) findViewById(R.id.LVLibrary); Library library = (Library) lv.getAdapter().getItem(info.position); new MenuInflater( this ).inflate(R.menu.context_mylibrary, menu); menu.setHeaderTitle(library.getName()); } |