@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; }
@Override public boolean onSearchRequested() { final ua.pocketbook.fb2viewer.fbreader.fbreader.FBReader fbreader = (ua.pocketbook.fb2viewer.fbreader.fbreader.FBReader) ZLApplication.Instance(); Log.i("FBReader", "onSearchRequested(), myPanel.ControlPanel = " + myPanel.ControlPanel); if (myPanel.ControlPanel != null) { final boolean visible = myPanel.ControlPanel.getVisibility() == View.VISIBLE; myPanel.ControlPanel.hide(false); SearchManager manager = (SearchManager) getSystemService(SEARCH_SERVICE); manager.setOnCancelListener( new SearchManager.OnCancelListener() { public void onCancel() { if ((myPanel.ControlPanel != null) && visible) { myPanel.ControlPanel.show(false); } } }); } startSearch(fbreader.TextSearchPatternOption.getValue(), true, null, false); return true; }