我正在尝试制作一个简单的 android 应用程序,但无法修复此错误。
该应用程序具有 4 个选项卡固定按钮导航,并且在第 4 个选项卡上并切换到另一个选项卡时会发生错误。在任何其他页面上都可以正常工作,但第 4 个选项卡每次都会导致致命错误。除了 TextView 元素之外,该页面上没有任何内容。谁能帮我找出问题所在或指出正确的方向?
02-17 21:48:54.378: E/AndroidRuntime(5543): FATAL EXCEPTION: main
02-17 21:48:54.378: E/AndroidRuntime(5543): android.view.InflateException: Binary XML file line #12: Error inflating class fragment
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
02-17 21:48:54.378: E/AndroidRuntime(5543): at com.example.testthree.MainActivity$MapSectionFragment.onCreateView(MainActivity.java:241)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.support.v4.app.Fragment.performCreateView(Fragment.java:1460)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:911)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.support.v4.app.FragmentManagerImpl.attachFragment(FragmentManager.java:1264)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:672)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1444)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:461)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.support.v4.view.ViewPager.populate(ViewPager.java:1012)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:523)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:495)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:476)
02-17 21:48:54.378: E/AndroidRuntime(5543): at com.example.testthree.MainActivity.onTabSelected(MainActivity.java:95)
02-17 21:48:54.378: E/AndroidRuntime(5543): at com.android.internal.app.ActionBarImpl.selectTab(ActionBarImpl.java:570)
02-17 21:48:54.378: E/AndroidRuntime(5543): at com.android.internal.app.ActionBarImpl$TabImpl.select(ActionBarImpl.java:1067)
02-17 21:48:54.378: E/AndroidRuntime(5543): at com.android.internal.widget.ScrollingTabContainerView$TabClickListener.onClick(ScrollingTabContainerView.java:489)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.view.View.performClick(View.java:4084)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.view.View$PerformClick.run(View.java:16966)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.os.Handler.handleCallback(Handler.java:615)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.os.Handler.dispatchMessage(Handler.java:92)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.os.Looper.loop(Looper.java:137)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.app.ActivityThread.main(ActivityThread.java:4745)
02-17 21:48:54.378: E/AndroidRuntime(5543): at java.lang.reflect.Method.invokeNative(Native Method)
02-17 21:48:54.378: E/AndroidRuntime(5543): at java.lang.reflect.Method.invoke(Method.java:511)
02-17 21:48:54.378: E/AndroidRuntime(5543): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
02-17 21:48:54.378: E/AndroidRuntime(5543): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
02-17 21:48:54.378: E/AndroidRuntime(5543): at dalvik.system.NativeStart.main(Native Method)
02-17 21:48:54.378: E/AndroidRuntime(5543): Caused by: java.lang.IllegalArgumentException: Binary XML file line #12: Duplicate id 0x7f04000f, tag null, or parent id 0x0 with another fragment for com.google.android.gms.maps.SupportMapFragment
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:285)
02-17 21:48:54.378: E/AndroidRuntime(5543): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
02-17 21:48:54.378: E/AndroidRuntime(5543): ... 30 more