How do i implement select and highlight text in android

流过昼夜 提交于 2019-12-10 18:57:15

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!