I want to achieve something like this — text selection plus custom actions ..
http://www.youtube.com/watch?feature=player_embedded&v=iwmG43D0vD4
I have done sufficient research on this topic and concluded that webview text selection and overriding it functionality is not possible ..
Seems that webview’s functionality is very limited atleast in the case of text manipulation.
I had decent success by accessing webview’s private nativeGetSelection method ( i was able to get selected text ).. but still i was unable to suppress the default dialog box .. and using private methods dosen’t seem to be a safe action tooo ..
I was about to scrap my thought of doing that project .. then i came to see that default web browser provides good text selection capability and further provides custom quick action to manipulate the text .. I am really confused at this point ….
can anyone .. with all their expertise … point out how to achieve that behavior .. ?
what view does google docs app use to achieve that behavior .. ?
I got something similar working in 2.2 – 4.0.3. I used a javascript interface and passed all touches to it. Of course to do that you’ll need enough control over the web content to include the javascript file. I have this solution in an app in production and I’ve put an example project on github. The github project includes the necessary js in the assets folder as well as a test page and web view that loads the test page and implements all necessary methods to handle the selection. The link to the github project is https://github.com/btate/BTAndroidWebViewSelection. Have at it.