我在我的應用程序中使用DrawerNavigator。 我創建了一個Android應用程序,它與Android 4.2完美的作品,但是當我嘗試推出它的Android 2.2我得到這個錯誤:使用抽屜導航充氣課程android 2.2的錯誤
android.view.InflateException: Binary XML file line #1: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:518)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:332)
at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)
at android.widget.AbsListView.obtainView(AbsListView.java:1582)
at android.widget.ListView.makeAndAddView(ListView.java:1801)
at android.widget.ListView.fillDown(ListView.java:724)
at android.widget.ListView.fillFromTop(ListView.java:781)
at android.widget.ListView.layoutChildren(ListView.java:1638)
at android.widget.AbsListView.onLayout(AbsListView.java:1412)
at android.view.View.layout(View.java:7175)
at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:672)
at android.view.View.layout(View.java:7175)
at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
at android.view.View.layout(View.java:7175)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)
at android.view.View.layout(View.java:7175)
at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
at android.view.View.layout(View.java:7175)
at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
at android.view.View.layout(View.java:7175)
at android.view.ViewRoot.performTraversals(ViewRoot.java:1146)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1866)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
編輯:這些線路是否也在那裏:
07-22 16:00:52.111: E/AndroidRuntime(470): Caused by: android.content.res.Resources$NotFoundException: File res/color/abs__primary_text_holo_light.xml from xml type drawable resource ID #0x0
07-22 16:00:52.111: E/AndroidRuntime(470): at android.content.res.Resources.loadXmlResourceParser(Resources.java:1924)
07-22 16:00:52.111: E/AndroidRuntime(470): at android.content.res.Resources.loadDrawable(Resources.java:1692)
07-22 16:00:52.111: E/AndroidRuntime(470): ... 42 more
我無法弄清楚爲什麼。 我打電話我fragment
(ShelrockFragment
)從MainActivity
:
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(R.id.content_frame, newsMasterFragment, "MasterFragment");
bundle.putBoolean("onFirstRow", true);
newsMasterFragment.setArguments(bundle);
和膨脹的看法時崩潰:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_news_master,
container, false);
如果您確定這是原因,那麼您可以將您的答案標記爲已接受。 –
明天不是今天 – alecnash