Reputation: 39
I'm using this code to search words within in a textView. The buttons and the EditText are displayed but they don't work. In the code there is a warning that says
The method
findAll(String)
from the typeWebView
is deprecated
for the line
wv.findAll(findBox.getText().toString());
The rest of the code is in this link.
Upvotes: 1
Views: 1133
Reputation: 4186
Use
wv.findAll(findBox.getText().toString());
for API versions < 16 and Use
wv.findAllAsync(findBox.getText().toString());
for API versions > 16.
Use the following code to ensure that your code works on all versions:
int API = android.os.Build.VERSION.SDK_INT;
if(API < 16) {
wv.findAll(findBox.getText().toString());
} else {
wv.findAllAsync(findBox.getText().toString());
}
Upvotes: 3