@TargetApi(Build.VERSION_CODES.JELLY_BEAN) public void findInPage(String s) { // to make it stop complaining if (ApiUtil.hasJellyBean()) { parentActivity.getCurPageFragment().getWebView().setFindListener(new FindListener() { @Override public void onFindResultReceived(int activeMatchOrdinal, int numberOfMatches, boolean isDoneCounting) { if (!isDoneCounting) { return; } if (numberOfMatches > 0) { findInPageMatch.setText( Integer.toString(activeMatchOrdinal + 1) + "/" + Integer.toString(numberOfMatches) ); findInPageNext.setEnabled(true); findInPagePrev.setEnabled(true); } else { findInPageMatch.setText("0/0"); findInPageNext.setEnabled(false); findInPagePrev.setEnabled(false); } findInPageMatch.setVisibility(View.VISIBLE); } }); parentActivity.getCurPageFragment().getWebView().findAllAsync(s); } else { //noinspection deprecation parentActivity.getCurPageFragment().getWebView().findAll(s); } }