我有一个 TextView,它打开另一个带有 webview 的布局。我希望 webview 填充http://m.twitter.com
但是,当单击 textview 时,它会打开布局,然后调用浏览器而不是填充 webview。
带有 textview 的原始布局:-
<TextView
android:id="@+id/GoToTCContacting"
android:layout_width="360dp"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_weight="2"
android:background="@drawable/border2"
android:clickable="true"
android:onClick="GoToTCContacting"
android:padding="10dp"
android:text="Contacting"
android:textColor="#FFF"
android:textSize="18sp" />
使用 WebView 的目标布局 (t_c_contacting)
<WebView
android:id="@+id/TCcontactingView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
用于函数的 Java
public void GoToTCContacting(View view)
{
setContentView(R.layout.t_c_contacting);
WebView webView = (WebView)findViewById(R.id.TCcontactingView);
webView.loadUrl("http://m.twitter.com");
}
我怎样才能让它填充webview而不调用默认浏览器