I’m new in Android Application. I am just wondering if there is a way to view a layout inside the webview? for example.
WebView webview = (WebView)findViewById(R.id.webView1);
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setBuiltInZoomControls(true);
String url = "Layout location or R.Layout.test";
webview.loadUrl(url);
It’s just like except of Using Activity class to View a layout like this
setContentView(R.layout.test);
I’m trying to view the layout in a webview.
Any thoughts will be highly appreciated.
Whatever you saw in the tutorial, I presume they may not be loading layouts INTO the
WebViewrather it may bealong withtheWebView.In other words,you can actually use layouts similar to divs in a HTML.. you take a layout, add Webview into it and then add Buttons and other controls out side the webview tags as shown by lgw150.
This may give one the impression that the buttons etc are inside the webview but they are actually not! You can have something like this:
For more check out this and this too.