0
我有5個按鈕,點擊按鈕後需要打開不同的網頁。如何做到這一點? 我的網頁流量的活動Java代碼:單擊按鈕後在我的應用程序內打開網頁
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class WebView extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView v, String url)
{
v.loadUrl(url);
return true;
}
}
和xml:
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context="lv.shit.test.Sakums" >
<webview android:id="@+id/manswebview"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</webview>
</linearlayout>
我應該寫上的OnClick什麼在我的web視圖中打開網頁?