Reputation: 10662
Is there a way to programmatically select all WebView content?
I know how to put the WebView into "text selection mode". But that relies on the user to do the selection, manually.
If there is a way to programmatically select all WebView content, how do I do that?
Upvotes: 8
Views: 2068
Reputation: 750
try mWebview.evaluateJavascript("document.execCommand('selectAll');",null);
Upvotes: 3
Reputation: 916
In Javascript you can iterate across all the "elements" and call .select()
on each one of them. Nothing specific to Android though.
Upvotes: 1