<LinearLayout 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:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.example.simonaddicott.controlpanel_1.numbers">
<SearchView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:id="@+id/numberSearch"
android:iconifiedByDefault="true"
android:inputType="text"
android:queryHint="@string/number_search_placeholder">
</SearchView>
<ListView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
</ListView>
</LinearLayout>
这给我渲染问题NullPointerException。为什么呢?
java.lang.NullPointerException at
android.content.res.TypedArray.hasValueOrEmpty(TypedArray.java:845) at
android.widget.SearchView.<init>(SearchView.java:295) at
android.widget.SearchView.<init>(SearchView.java:258) at
android.widget.SearchView.<init>(SearchView.java:254) at
java.lang.reflect.Constructor.newInstance(Constructor.java:408) at
android.view.LayoutInflater.createView(LayoutInflater.java:607) at
android.view.LayoutInflater.onCreateView(LayoutInflater.java:682) at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741) at
android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:806) at
android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:782) at
android.view.LayoutInflater.inflate(LayoutInflater.java:504) at
android.view.LayoutInflater.inflate(LayoutInflater.java:385)
我在错误报告中看不到xml中的错误或与我的代码有关的任何内容。我阅读了android dev网站上的文档,我看不出任何其他需要的内容。