How to implement text selection and highlighting in android

I am working on an e-book reader application, and I need to implement a highlight and highlight function, for example, implemented in Amazon-kindle, kobo, moon + reader, etc.

I tried using WebView, since we can select text in 2.3 and later versions of Android OS with a long touch. I do not get the window.getSelection () object, so my JavaScript does not highlight the text.

This is possible because other applications have implemented this feature.

Does anyone know how to do this? Is there a special API that I need to use?

here is a screen capture from kindle app.

+3
android android widget
source share
1 answer

Take a look at this open source project here.

This is a great job to select and copy in android web view.

0
source share

All Articles