• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

In Android Identify particular click in WebView (After loading the particular URL ,I want to identif

Dhanaraj J

Lurker
Feb 14, 2018
1
0
Hi ,

In my android mobile application , I have have a current scenario like

step1: For example I have URL

Step2: I will pass this URL to Web view

WebView mywebview = (WebView) findViewById(R.id.webView1);
mywebview.loadUrl("file:///android_asset/myresource.html");

Step3: After loading this URL,it will display the above URL in the device

onPageFinished(WebView view, String url) {

}
Step4:
In the above displayed page I have a button like

<form method="get" action="some redirect URL">
<button class="class name"> Download</button>
<form>

Once I clicked on this download button pop up will show in the existing page



This is the working code currently I have now .

Now my requirement is


After Step3

Once I click on the download button ,I need to track that particular click in the WebView ,

How can I identify that particular click ?

I already gone through the below URL but no luck

https://stackoverflow.com/questions...ic-button-has-been-clicked-in-android-webview

and also I tried the WebViewClient method
shouldOverrideUrlLoading(WebView view, WebResourceRequest request)
But no use

Can anyone please help me in this .
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones