Occur some event when click on Webview - android

I am using webview in my application which opens html website. Now as per requirement of my company, I need to occure some event when user click on webview.
I have tried setOnClickListener() event but it dint work.
Please guide me for it. Thank you.

create a framelayout and then set webview inside on it, put your onlclick listener on the framelayout

Related

webview not working onclick rather than the ontouch in android

i am newbie to android so just appologies if any issues come across for the asking questions regarding webview.if i try to swipe the webview it is working fine when implementing ontouchlistener using the answer from Fling gesture detection on grid layout. But i had a problem with onclick of hyperlink in the webview.if i try to click the hyperlink while i didn't get any appropriate page(onclick is not detecting).so please can you give any possible answer for this.
just check your ontouchlistener because event not consuming overthere.except getting swipe value block ramaining all must return false.

Jump to anchor from button

What's the better solution to navigate to a certain point of a html page in a webview using android native buttons?
Is it possible to navigate html anchors?
What about using anchors like this:
First section
And then in your button's OnClick handler make your webview navigate to: http://yoururl.com/page.html#first
Does that work?
It seems there are some issues when the WebView is inside a ScrollView, you can read about it here: Android Webview Anchor Link (Jump link) not working

Click on webview and on listener at the same time

I have an invisible listener above of webview and i want that when the user click on this area, the invisible listener does something and if the web has some button, it does like if the invisible listener doesn't exist.
Look into the use of Javascript interfaces within WebView. Please see this area of the Android Developers Guide. Basically, you should be able to communicate from the page to the device with the Javascript interface and let your WebView Activity know whether the button on the page is present or not.

Android WebView link highlight issue

So I have a html app that I'm loading in a WebView. The thing is I want to use shouldOverrideUrlLoading not to load a specific link, when it gets clicked, so I return true in that method, not loading the url. This works great, but the link is getting highlighted as if it was clicked. Is there a way that I can remove the highlighting if the link was pressed but not loaded?
Thanks
You could have one of a few problems, Clicking on the link in android webview does not get highlighted visually says you have to set Javascript as enabled with:
webView.getSettings().setJavascriptEnabled(true);
There's also been an issue with focus at Android:Webview with link highlight, where you should request focus on your webview with:
webView.requestFocus(View.FOCUS_DOWN);

how to handle HTML image click events in android

I have to create an HTML page which have more than one images. If User clicks on any image then I have to show full view of open gallery in android. I am able to create galley in android. But I cannot understand how to handle button click in html so that It will give call back to my android gallery activity.
Thanks
Deepak
Check this: http://developer.android.com/guide/webapps/webview.html
See the Binding JavaScript code to Android code section, you can bind JavaScript event to Android code:)
Refer to answer of get the click event from webpage in my android application

Categories

Resources