ClickableWebView icon indicating copy to clipboard operation
ClickableWebView copied to clipboard

How to get click of links

Open shrivastavaanurag opened this issue 8 years ago • 1 comments

Hi Ahmad, Thanks for the nice

webview

. I am developing an android app in which i need to make a webview where the links should be open in another activity. I don't how do i make this, I found your code on android-arsenal, I was trying to get the click of links not image, didn't understand how to do this. What do i use instead of IMAGE_TYPE in

if (listener != null && hr.getType() == IMAGE_TYPE) { listener.onClick(hr.getExtra()); }

Please help me to solve this problem.

shrivastavaanurag avatar Mar 25 '17 05:03 shrivastavaanurag

You can extents your WebViewClient and override its method shouldOverrideUrlLoading. In that method, you can use codes as follows:

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
mContext.startActivity(intent);

mybuddy avatar Jun 29 '17 14:06 mybuddy