本文整理了Java中android.webkit.WebView.findAll()
方法的一些代码示例,展示了WebView.findAll()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebView.findAll()
方法的具体详情如下:
包路径:android.webkit.WebView
类名称:WebView
方法名:findAll
暂无
代码示例来源:origin: calvinaquino/LNReader-Android
@SuppressWarnings("deprecation")
private void search(WebView webView, String string) {
if (string != null && string.length() > 0)
webView.findAll(string);
try {
Method m = NonLeakingWebView.class.getMethod("setFindIsUp", Boolean.TYPE);
m.invoke(webView, true);
} catch (NoSuchMethodException me) {
} catch (Exception e) {
Log.e(TAG, "Error when searching", e);
}
}
代码示例来源:origin: bkhezry/ExtraWebView
private void findInPage() {
String query = mEditText.getText().toString().trim();
if (TextUtils.isEmpty(query)) {
return;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
mWebView.setFindListener(new WebView.FindListener() {
@Override
public void onFindResultReceived(int activeMatchOrdinal, int numberOfMatches, boolean isDoneCounting) {
if (isDoneCounting) {
handleFindResults(numberOfMatches);
}
}
});
mWebView.findAllAsync(query);
} else {
//noinspection deprecation
handleFindResults(mWebView.findAll(query));
}
}
代码示例来源:origin: stackoverflow.com
String strr=search_text.getText().toString();
WebView web=(WebView)findviewbyid(R.id.webview);
web.findAll(strr);
try {
for (Method m : WebView.class.getDeclaredMethods()) {
if (m.getName().equals("setFindIsUp")) {
m.setAccessible(true);
m.invoke((web), true);
break;
}
}
} catch (Exception ignored) {
}
代码示例来源:origin: apps4av/avare
@Override
public void onTextChanged(CharSequence s, int start, int before, int after) {
/*
* If text is 0 length or too long, then do not search, show last list
*/
if(s.length() < 3) {
mWebView.clearMatches();
return;
}
mProgressBar.setVisibility(ProgressBar.VISIBLE);
mWebView.findAll(s.toString());
mProgressBar.setVisibility(ProgressBar.INVISIBLE);
}
});
代码示例来源:origin: stackoverflow.com
mWebView.findAll(findBox.getText().toString());
内容来源于网络,如有侵权,请联系作者删除!