Android Question WebView navigator clipboard functionality

3fazeac

Member
Licensed User
Longtime User
Post upload-files-with-webview.98623/#content shows how to use the navigator.geolocation feature of the chrome browser in a WebView. Is it also possible to gain access to the navigator.clipboard functionality for a B4X WebView object? Is it simpler to use the executeJavascript member of the WebViewsExtra class to read an HTML object which can be made to operate like a clipboard at least for the purposes of transferring data back to the B4X program?
 

drgottjr

Expert
Licensed User
Longtime User
the hardest part about copying selected text from a webview is the act
of selecting.

that said, i have no problem copying to/from the clipboard. please refer to
the attached images.

technically, evaluatejavascript() in the context of a valuecallback does work,
but it isn't necessary, as the prompt to copy the selected text to the
clipboard is already sitting there for you. either way, you have to have
some kind of button to capture the selection in a timely manner.
 

Attachments

  • 1.png
    1.png
    31.6 KB · Views: 267
  • 2.png
    2.png
    28.2 KB · Views: 281
  • 3.png
    3.png
    35.1 KB · Views: 296
Upvote 0
Top