Hello all,
I have a question about the findAll function in WebViews. I know that it
is deprecated, in eclipse this comes up "The method findAll(String) from
the type WebView is deprecated". I am targeting 4.1 (API 16) with a
minimum of 2.2 (API 8). This is the code I have:
public boolean onKey(View v, int keyCode, KeyEvent event) {
if ((event.getAction() == KeyEvent.ACTION_DOWN)
&& ((keyCode == KeyEvent.KEYCODE_ENTER))) {
wv.findAll(findBox.getText().toString());
try {
Method m = WebView.class.getMethod("setFindIsUp",
Boolean.TYPE);
m.invoke(wv, true);
} catch (Exception ignored) {
}
}
return false;
}
Also, I know that findAllAsync is the new way to do things but this still
does not work across all android versions. I just want to have a
functioning find/search in a WebView. So far this functions great for only
*some *versions of android, versions such as 4.0, 4.0.3, and I believe 3.0
do not function correctly.
Older versions of android such as the 2.x series and my nexus s on 4.1 work
great.
Anyone know of a workaround for a search or find function to work on all
android versions? If there is something completely different from this I
am willing to listen, at this point I only am looking for a functioning
search on all versions.
Thanks everybody!
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en