You can place a view group and then put the web view inside and resize as needed
<LinearLayout android:orientation="vertical" android:gravity="center" android:layout_width="match_parent" android:layout_height="wrap_content"> <WebView android:id="@+id/webView" android:layout_width="fill_parent" android:layout_height="fill_parent"> </WebView> </LinearLayout>
In the manifest file, specify permission
<uses-permission android:name="android.permission.INTERNET" />
then you get the object from the code
WebView myWebView = (WebView) findViewById(R.id.webview); myWebView.loadUrl("http://www.google.com");
Ranjithkumar
source share