0

I have an app, that has an Activity with WebView. I'm looking for a way to get parent html element when user clicks WebView.

For instance: user goes to web-site, clicks some text block and I want to get div, that contains this text block. Is it possible? I found class WebView.HitTestResult in the docs, but seems like it only can to retrieve anchor and image tags.

mol
  • 2,607
  • 4
  • 21
  • 40
  • alternatively you can parse the site by JSOUP and then manually search for the necessary flow – Dmitriy Puchkov Jun 18 '15 at 10:47
  • @gabber The problem is that I need the element, that user clicks on. It may be not only div, but other tags too. It is like Firefox inspector feature (for developers). When you hover over some html element, it shows it's boundaries. I need to reach similar behaviour. I don't need to highligh element, but retrieve it with all attributes. – mol Jun 18 '15 at 11:15
  • maybe it helps http://stackoverflow.com/questions/5907439/get-the-click-event-from-webpage-in-my-android-application – Dmitriy Puchkov Jun 18 '15 at 11:18
  • @gabber Thank you. I've already encountered this question. Using this methods you can only detect clicks on images or anchors. – mol Jun 18 '15 at 11:55

0 Answers0