【发布时间】:2014-02-07 12:57:45
【问题描述】:
我在 android 活动中创建了一个 web 视图 我的任何代码都没有错误。 但是当它运行时它试图在谷歌浏览器中打开。
这是我的代码
public class MyCustomListView extends Activity {
private WebView webView;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_custom_list_view);
webView = (WebView) findViewById(R.id.webView1);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("http://www.google.com");
}
}
和xml布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<WebView
android:id="@+id/webView1"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="0.87" />
<Button
android:id="@+id/btn_back"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Back"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
并记录 cat 显示此内容 不应该发生没有找到基于 rect 的测试节点
【问题讨论】:
标签: android