我一直得到这个错误,我不太确定它的原因是什么?我已经尝试更改xml文件和样式xml文件,但没有运气。我不确定类TextView意味着什么?
XML文件
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/waterRefresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/listofitems"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
</android.support.v4.widget.SwipeRefreshLayout>
<TextView
android:id="@+id/empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="Empty List" />
</RelativeLayout>
错误记录
android.view.InflateException: Binary XML file line #28: Binary XML file line #28: Error inflating class TextView
at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.support.v4.widget.ResourceCursorAdapter.newView(ResourceCursorAdapter.java:106)
at android.support.v4.widget.CursorAdapter.getView(CursorAdapter.java:252)
at android.widget.AbsListView.obtainView(AbsListView.java:2389)
at android.widget.ListView.makeAndAddView(ListView.java:1878)
at android.widget.ListView.fillDown(ListView.java:705)
at android.widget.ListView.fillFromTop(ListView.java:766)
at android.widget.ListView.layoutChildren(ListView.java:1687)
at android.widget.AbsListView.onLayout(AbsListView.java:2191)
at android.view.View.layout(View.java:16694)
at android.view.ViewGroup.layout(ViewGroup.java:5481)
at android.support.v4.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:596)
at android.view.View.layout(View.java:16694)
at android.view.ViewGroup.layout(ViewGroup.java:5481)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
at android.view.View.layout(View.java:16694)
at android.view.ViewGroup.layout(ViewGroup.java:5481)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16694)
at android.view.ViewGroup.layout(ViewGroup.java:5481)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16694)
at android.view.ViewGroup.layout(ViewGroup.java:5481)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16694)
at android.view.ViewGroup.layout(ViewGroup.java:5481)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
at android.view.View.layout(View.java:16694)
at android.view.ViewGroup.layout(ViewGroup.java:5481)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16694)
at android.view.ViewGroup.layout(ViewGroup.java:5481)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16694)
at android.view.ViewGroup.layout(ViewGroup.java:5481)
at android.support.v7.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:435)
at android.view.View.layout(View.java:16694)
at android.view.ViewGroup.layout(ViewGroup.java:5481)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16694)
at android.view.ViewGroup.layout(ViewGroup.java:5481)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
at android.view.View.layout(View.java:16694)
at android.view.ViewGroup.layout(ViewGroup.java:5481)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2697)
at android.view.View.layout(View.java:16694)
at android.view.ViewGroup.layout(ViewGroup.java:5481)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2228)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1981)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1140)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6239)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.vie