WebView布局返回null值

时间:2012-04-22 22:56:10

标签: android android-layout

我的一项活动布局非常简单

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/widget50"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android">
<WebView  xmlns:android="http://schemas.android.com/apk/res/android"
                  android:id="@+id/webview"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"/>
</LinearLayout>

在我的onCreate()方法中,我初始化了webview:

webview = (WebView) findViewById(R.id.webview);

之后我立即打印出webview是否为null,并且确实为null。怎么会这样?

0 个答案:

没有答案