I have created two webviews
and need to put them under each other but it overlaps each other instead of going under each other. Which means that only the second screen webview
is being displayed and not both.
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<WebView
android:id="@+id/webview2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:scrollbars="none"
android:textColor="@android:color/black" />
<WebView
android:id="@+id/webview1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:scrollbars="none"
android:textColor="@android:color/black" />
</LinearLayout>
</ScrollView>
MainActivity.java
public class MainActivity extends Activity {
WebView webView, webview2;
CheckBox cbk1, cbk2;
@SuppressLint("JavascriptInterface")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
webView = (WebView) findViewById(R.id.webview2);
webview2 = (WebView) findViewById(R.id.webview1);
webView.loadUrl("file:///android_asset/nextscreen.html");
webview2.loadUrl("file:///android_asset/newscreen2.html");
}
}