Android Webview - how to capture a word being clicked?
I am loading a webpage in WebView an开发者_JS百科d am required to recognize a word (any word from the page, not just URL) being clicked by user. Is it possible? how?
Thanks a lot.
EDIT: This is done in Aldiko 2.0. No Javascript.
you have to work with HTML events.
Easiest way would be to set an onClick event for each word - so you would have to surround all words with spans.
As soon as you get the event in javascript, you have to send the info to your main java app.
I've seen the aldiko.com website. They already have a way to detect what word is pressed (to search for it). If you want to do something with this would should ask for an API from them to receive the word.
Without Javascript or their API i'm not seeing a viable alternative.
精彩评论