Widget - Webview Find

edittext1.setSingleLine(true);

edittext1.setOnKeyListener(new OnKeyListener() {

public boolean onKey(View v, int keyCode, KeyEvent event) {
if ((event.getAction() == KeyEvent.ACTION_DOWN) && ((keyCode == KeyEvent.KEYCODE_ENTER))) {

webview1.findAll(edittext1.getText().toString());
try {
for (java.lang.reflect.Method m : WebView.class.getDeclaredMethods()) {
if (m.getName().equals("setFindIsUp")) {
m.setAccessible(true);
m.invoke(webview1, true);
break;
}
}
} catch (Exception ignored) {
} finally {
android.view.inputmethod.InputMethodManager inputManager = (android.view.inputmethod.InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
View vv = getCurrentFocus();
if (vv != null) {
inputManager.hideSoftInputFromWindow(v.getWindowToken(), android.view.inputmethod.InputMethodManager.HIDE_NOT_ALWAYS);
}
}
}
return false;
}
});

//Add Button For Next Add this on button Listener
webview1.findNext(true);

//Add Button Close Search add this again
webview1.clearMatches();

Komentar

Cara pembuatan Apps paling Populer

Create Stopwatch App in Android using Sketchware

TextInputLayout in Sketchware

How to find and​ highlight a word in a text field in Sketchware?

A Flash Light App in Sketchware

How to enable download in webview in Sketchware apps?

Intent - Open File By Type

Code for implementing Notifications in Sketchware

How to share an image from Drawable folder?

ActionBar back button

Animation Transtition Animation