<a href="url_href" data-href="WANTED_URL">Click me</a>
In android webview is there any way to get url specified in custom attributes?
In my problem I need to get url present in data-href(i.e WANTED_URL) attributes when the user click on Click me link
Whenever user clicks on Click me link android provides url present in href attributes.Is there any way to get url present in custom attributes?
WebView doesn't provide you with any information about the HTML elements you have clicked.
If you own the page you are showing in WebView, then one possible way to achieve your goal would be to encode
WANTED_URL
insideurl_href
, then parse it insideWebViewClient.shouldInterceptRequest
(http://developer.android.com/reference/android/webkit/WebViewClient.html#shouldInterceptRequest(android.webkit.WebView,%20java.lang.String)).