Sunday, April 28, 2013

[android help] ActionBar Tab and Master Detail Layout


I'm having an issue with the actionbar tabs and getting the master/detail layout to work.


I have the a master/detail working but I am now adding tabs, so I can select a different layout. But, it seems to crash with the error:



04-27 13:00:45.805: E/AndroidRuntime(5161): android.view.InflateException: Binary XML file line #24: Error inflating class fragment
04-27 13:00:45.805: E/AndroidRuntime(5161): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
04-27 13:00:45.805: E/AndroidRuntime(5161): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
04-27 13:00:45.805: E/AndroidRuntime(5161): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
04-27 13:00:45.805: E/AndroidRuntime(5161): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
04-27 13:00:45.805: E/AndroidRuntime(5161): at com.example.example.masterdetail_tabs.Tab1Fragment.onCreateView(Tab1Fragment.java:17)
04-27 13:00:45.805: E/AndroidRuntime(5161): at android.app.Fragment.performCreateView(Fragment.java:1695)
04-27 13:00:45.805: E/AndroidRuntime(5161): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:885)
04-27 13:00:45.805: E/AndroidRuntime(5161): at android.app.FragmentManagerImpl.attachFragment(FragmentManager.java:1255)
04-27 13:00:45.805: E/AndroidRuntime(5161): at android.app.BackStackRecord.run(BackStackRecord.java:672)
04-27 13:00:45.805: E/AndroidRuntime(5161): at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1435)
04-27 13:00:45.805: E/AndroidRuntime(5161): at android.app.FragmentManagerImpl$1.run(FragmentManager.java:441)
04-27 13:00:45.805: E/AndroidRuntime(5161): at android.os.Handler.handleCallback(Handler.java:725)
04-27 13:00:45.805: E/AndroidRuntime(5161): at android.os.Handler.dispatchMessage(Handler.java:92)
04-27 13:00:45.805: E/AndroidRuntime(5161): at android.os.Looper.loop(Looper.java:137)
04-27 13:00:45.805: E/AndroidRuntime(5161): at android.app.ActivityThread.main(ActivityThread.java:5041)
04-27 13:00:45.805: E/AndroidRuntime(5161): at java.lang.reflect.Method.invokeNative(Native Method)
04-27 13:00:45.805: E/AndroidRuntime(5161): at java.lang.reflect.Method.invoke(Method.java:511)
04-27 13:00:45.805: E/AndroidRuntime(5161): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
04-27 13:00:45.805: E/AndroidRuntime(5161): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
04-27 13:00:45.805: E/AndroidRuntime(5161): at dalvik.system.NativeStart.main(Native Method)
04-27 13:00:45.805: E/AndroidRuntime(5161): Caused by: java.lang.IllegalArgumentException: Binary XML file line #24: Duplicate id 0x7f060001, tag null, or parent id 0x0 with another fragment for com.example.example.masterdetail_tabs.ItemListFragment
04-27 13:00:45.805: E/AndroidRuntime(5161): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:285)
04-27 13:00:45.805: E/AndroidRuntime(5161): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)


I have created a simple application to recreate the issue (don't know if it's an issue but I'm using actionbarsherlock in the real app)


https://github.com/abidk/android_masterdetail_tab_issue


Does anyone have any ideas what I am doing wrong?



.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...