I have 2 types in the application:
but. res / layout / main.xml - standard view with 1 button
b. res / layout / web_view.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <WebView android:id="@+id/webview" android:layout_height="fill_parent" android:layout_width="fill_parent" /> </LinearLayout>
When I click the button on the first view (a), it loads the webview (b) and loads the url:
// click on the "Browser" button in view a public void goToWebView(View view) { setContentView(R.layout.web_view); WebView mWebView = (WebView) findViewById(R.id.webview); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.loadUrl("http://www.google.com"); }
Everything that works fine, loading the url is fine, but the browser is created in its own form (the third, not b itself), and my goal is to use Webview to display some HTML code in my application, and not outside it, in a separate browser .
Anyboyd any idea?
This is done using the level8 / Android 2.2 API.
Thank you for your help. Floor
android android-webview
Paul
source share