Re: [android-developers] Fragment within a fragment?
This is really unfortunate. I've been developing an app with nested fragments that works fine on Android 3.1. I just started testing on an Android 3.2 device, and it is now throwing the following exception: E/AndroidRuntime( 3580): Caused by: java.lang.IllegalArgumentException: Binary XML file line #41: Duplicate id 0x7f0f0086, tag null, or parent id 0x with another fragment for com.ipass.wifiapp.NetworkListFragment I don't really want to nest the fragments, but I don't have a choice since I'm using ActionBar tabs, which by definition only accepts fragments to be added as tabs. Now it appears I have to convert my fragments back into custom views to work around this limitation, which for whatever reason didn't exist in 3.1. Ugh!! Do you have any other ideas I can try to preserve the fragments I've already built? Thanks. Pedro On Wednesday, November 16, 2011 1:24:27 PM UTC-8, Mark Murphy (a Commons Guy) wrote: On Wed, Nov 16, 2011 at 1:38 PM, Doug Gordon gordo...@gmail.com wrote: So Fragment A is instantiated, inflates its view, and goes on its merry way. Can Fragment A later instantiate a Fragment B and add it to one of Fragment A's own child views, thus creating a sort of fragment within a fragment? No, sorry, Ms. Hackborn has indicated that nesting fragments in fragments is not supported. There's a StackOverflow post or two on this topic. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 2.1 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Fragment within a fragment?
On Mon, Mar 19, 2012 at 7:47 PM, Pedro pl...@ipass.com wrote: I don't really want to nest the fragments, but I don't have a choice since I'm using ActionBar tabs, which by definition only accepts fragments to be added as tabs. Nonsense. Just because you are handed a FragmentTransaction does not mean you have to use it. You are welcome to do anything you want when the user clicks an action bar tab. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android App Developer Books: http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Fragment within a fragment?
On Wed, Nov 16, 2011 at 1:38 PM, Doug Gordon gordo...@gmail.com wrote: So Fragment A is instantiated, inflates its view, and goes on its merry way. Can Fragment A later instantiate a Fragment B and add it to one of Fragment A's own child views, thus creating a sort of fragment within a fragment? No, sorry, Ms. Hackborn has indicated that nesting fragments in fragments is not supported. There's a StackOverflow post or two on this topic. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 2.1 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en