问题
I am working on eBook reader app and I need to implement select and highlight feature like implemented in Amazon-kindle, kobo,moon+ reader etc.
I tried with WebView as we can select text in 2.3 and later versions of android OS on long touch event. I am not getting the window.getSelection() object so my JavaScript is not highlighting the text.
This is possible, as other apps have implemented this feature.
Does anyone know how to do this? Is there a special API I need to use?
回答1:
Have a look at this open source project here
It is a wonderful work for select and copy in android webview.
来源:https://stackoverflow.com/questions/8656395/how-do-i-implement-select-and-highlight-text-in-android