@Override public boolean onContextItemSelected(MenuItem item) { final int position = ((AdapterView.AdapterContextMenuInfo) item.getMenuInfo()).position; final BookmarksAdapter adapter = myThisBookAdapter; final Bookmark bookmark = adapter.getItem(position); switch (item.getItemId()) { case OPEN_ITEM_ID: gotoBookmark(bookmark); return true; case EDIT_ITEM_ID: final Intent intent = new Intent(this, EditBookmarkActivity.class); intent.putExtra("bgColor", bgValue); KooReaderIntents.putBookmarkExtra(intent, bookmark); OrientationUtil.startActivity(this, intent); return true; case DELETE_ITEM_ID: myCollection.deleteBookmark(bookmark); return true; } return super.onContextItemSelected(item); }
@Override public boolean onContextItemSelected(MenuItem item) { final int position = ((AdapterView.AdapterContextMenuInfo) item.getMenuInfo()).position; final String tag = myTabHost.getCurrentTabTag(); final BookmarksAdapter adapter; if ("thisBook".equals(tag)) { adapter = myThisBookAdapter; } else if ("allBooks".equals(tag)) { adapter = myAllBooksAdapter; } else if ("search".equals(tag)) { adapter = mySearchResultsAdapter; } else { throw new RuntimeException("Unknown tab tag: " + tag); } final Bookmark bookmark = adapter.getItem(position); switch (item.getItemId()) { case OPEN_ITEM_ID: gotoBookmark(bookmark); return true; case EDIT_ITEM_ID: final Intent intent = new Intent(this, EditBookmarkActivity.class); KooReaderIntents.putBookmarkExtra(intent, bookmark); OrientationUtil.startActivity(this, intent); return true; case DELETE_ITEM_ID: myCollection.deleteBookmark(bookmark); return true; } return super.onContextItemSelected(item); }
@Override public boolean onContextItemSelected(MenuItem item) { final int position = ((AdapterView.AdapterContextMenuInfo) item.getMenuInfo()).position; final BookmarksAdapter adapter = myThisBookAdapter; final Bookmark bookmark = adapter.getItem(position); switch (item.getItemId()) { case OPEN_ITEM_ID: gotoBookmark(bookmark); return true; case EDIT_ITEM_ID: final Intent intent = new Intent(this, EditBookmarkActivity.class); intent.putExtra("bgColor", bgValue); KooReaderIntents.putBookmarkExtra(intent, bookmark); OrientationUtil.startActivity(this, intent); return true; case DELETE_ITEM_ID: myCollection.deleteBookmark(bookmark); return true; } return super.onContextItemSelected(item); }
@Override public boolean onContextItemSelected(MenuItem item) { final int position = ((AdapterView.AdapterContextMenuInfo) item.getMenuInfo()).position; final BookmarksAdapter adapter = myThisBookAdapter; final Bookmark bookmark = adapter.getItem(position); switch (item.getItemId()) { case OPEN_ITEM_ID: gotoBookmark(bookmark); return true; case EDIT_ITEM_ID: final Intent intent = new Intent(getActivity(), EditBookmarkActivity.class); KooReaderIntents.putBookmarkExtra(intent, bookmark); OrientationUtil.startActivity(getActivity(), intent); return true; case DELETE_ITEM_ID: myCollection.deleteBookmark(bookmark); return true; } return super.onContextItemSelected(item); }
return true; case DELETE_ITEM_ID: myCollection.deleteBookmark(bookmark); return true;