You don't need to supply a style reference, as long as you are
instantiating them from a Context with the desired theme set up.  This
is one reason to use the Activity context (or Dialog context) to
instantiate the views -- this context has a theme set that matches the
desired activity/dialog style.

Fwiw, the way a view resolves its style is to either use the style
resource you explicitly give it, or look up a style resource from an
attribute it has defined for itself in the current theme.  Details on
all of these are in the documentation for
Theme.obtainStyledAttributes():

http://code.google.com/android/reference/android/content/Resources.Theme.html#obtainStyledAttributes(android.util.AttributeSet,%20int[],%20int,%20int)

This is the method that the view classes call to load their attributes
out of the XML file / style resource given to them.

On Apr 9, 9:15 am, Hielko <[EMAIL PROTECTED]> wrote:
> You can create exactly the same things without xml I think, but if you
> want things to look the same you should probably supply a reference to
> the style you want to use for some views when you construct them.
>
> On Apr 9, 11:40 am, simon <[EMAIL PROTECTED]> wrote:
>
> > Ok. That was a good tip. Thanx for that. I managed to create a UI
> > without XML files plus a Database Adapter.
> > But does UI-Processing without XML really cover all functions and
> > possibilities that you have by using XML files? I did not manage to
> > make the list I created look good. that means it looks like the list
> > in the notepad example. the highlight of a selected list item always
> > reaches into the upper and lower list item. and i don't know what i
> > can do about it.
>
> > Is this just the still buggy platform or am i doing anything wrong?
>
> > On 3 Apr., 21:22, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > On Apr 3, 11:55 am, "Dan U." <[EMAIL PROTECTED]> wrote:
>
> > > > But if he's trying to use the CursorAdapter, is that even possible?
> > > > The constructor needs an id of a layout xml file.
>
> > > The base adapter interface just has a method to get a new view.  You
> > > can implement that however you want.- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to