public void hideSelectionPanel() { final FBReaderApp fbReader = (FBReaderApp) FBReaderApp.Instance(); final FBReaderApp.PopupPanel popup = fbReader.getActivePopup(); if (popup != null && popup.getId() == SelectionPopup.ID) { FBReaderApp.Instance().hideActivePopup(); } }
@Override public boolean onSearchRequested() { final FBReaderApp fbreader = (FBReaderApp) FBReaderApp.Instance(); final FBReaderApp.PopupPanel popup = fbreader.getActivePopup(); fbreader.hideActivePopup(); final SearchManager manager = (SearchManager) getSystemService(SEARCH_SERVICE); manager.setOnCancelListener( new SearchManager.OnCancelListener() { public void onCancel() { if (popup != null) { fbreader.showPopup(popup.getId()); } manager.setOnCancelListener(null); } }); startSearch(fbreader.TextSearchPatternOption.getValue(), true, null, false); return true; }