package com.quinnco.PakageName;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.webkit.WebSettings;
import android.webkit.WebView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView myWebView = (WebView) findViewById(R.id.Feed);
myWebView.loadUrl("link two");
WebSettings websettings=myWebView.getSettings();
WebSettings.setJavaScriptEnabled(true);
WebView myWebView = (WebView) findViewById(R.id.Chat);
myWebView.loadUrl("link one");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<WebView
android:id="@+id/Chat"
android:layout_width="fill_parent"
android:layout_height="175dp"
android:layout_alignLeft="@+id/Feed"
android:layout_alignParentTop="true" />
<WebView
android:id="@+id/Feed"
android:layout_width="fill_parent"
android:layout_height="175dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/Chat" />
</RelativeLayout>
我这样做是为了以防万一所有链接和包名都被更改,我知道这只是帮助主要的 ActivityMain.Java 这两个 webviews 在同一页面上,我不知道该怎么做。请帮忙