Issue
I am creating a webview application such that. The application layout has WebView stacked over another WebView; it means essentially there are two webviews in the layout.
Now what I want is - When a user clicks anywhere on the 2nd webview (which is at bottom) a new activity with new layout opens loading a particular URL.
Any Ideas??
Solution
You can listen to touch listeners instead of clicks like this:
webView = (WebView) findViewById(R.id.myWebViewId);
webView.setOnTouchListener(new View.OnTouchListener() {
Uri uriUrl = Uri.parse("http://myurl.com");
Intent launchBrowser = new Intent(Intent.ACTION_VIEW, uriUrl);
startActivity(launchBrowser);
return true;
}
});
Answered By - andy boot
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.