You need to do this manually -- use ContextThemeWrapper to build a new Context with the desired theme, and use that to inflate your view hierarchy.
On Tue, May 17, 2011 at 10:04 AM, Bruno Bruggemann < [email protected]> wrote: > Hi, > > I'm creating a new layout for an app using fragments. And in a screen, > I need to apply a specific theme just for one fragment, but I can't do > that. To make sure that I did the right thing, I applied the same > theme on an old activity and it works. The app already has a theme > defined, but on this screen I need a different theme because the > background is white and with current theme the line below of the > EditText don't appears. > > Below how is my manifest: > <activity > android:name="activity1" > android:theme="@style/ThemeHoloLight" > android:label="@string/labelActivity"> > </activity> > > And the style file is: > <style name="ThemeHoloLight" parent="@android:style/ > Theme.Holo.Light"> > </style> > > About the fragment, below is how I'm starting it: > > Activity1 activity1 = new Activity1(); > > FragmentTransaction ft = > getFragmentManager().beginTransaction(); > ft.replace(R.id.fragment1, activity1); > > ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); > ft.addToBackStack("fragment1"); > ft.commit(); > > Below is how is my layout: > <FrameLayout > android:id="@+id/fragment1" > android:layout_width="fill_parent" > android:layout_height="fill_parent" > android:layout_alignParentBottom="true" /> > > Thanks for any help! > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

