All of the APIs you need -- Theme.obtainStyledAttributes() in particular -- are part of the SDK.
As we just covered in another thread, there is no API to change/reapply a style on a view after that view has been constructed. This is not a matter of there being a public API, it is simply not something that is supported at all. The code you originally posted showed you manually retrieving the values you are interested in from a style and calling setters on a view, which you can certainly do. On Tue, Feb 3, 2009 at 10:35 PM, Kennard Consulting < [email protected]> wrote: > > Dianne, > > Thanks for the prompt reply. However, I don't think your answer works > in my case, as what I am trying to do is a little unusual. > > I'm trying to apply styles *programmatically*, like the Android > framework does internally using (I think) AssetManager.applyStyle and/ > or Theme.obtainStyleAttributes. However, neither of these are exposed > in the public API. > > Is there a way, in the public API, to apply a style to a View at > runtime, given the style id and the View object? For example... > > TextView view = new TextView(); > applyStyle( view, R.mystyle ); > > Regards, > > Richard. > > > > -- 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. 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 -~----------~----~----~----~------~----~------~--~---

