On 13 mayo, 20:27, lilbyrdie <[email protected]> wrote:
> I've answered my own question. Net result is the same, just a
> different way of getting to the default theme resources, but it's what
> I was missing.
>
> Within your attrs.xml file, place a block that looks like the
> following:
>
>     <declare-styleable name="default_gallery">
>         <attr name="android:galleryItemBackground" />
>     </declare-styleable>
>
> This basically provides access to the galleryItemBackground in the
> same way as before, but explicitly making it a styleable now.
>
> This is now used as before:
>
> Within the ImageUriAdapter(), load the background:
>                         TypedArray a = 
> obtainStyledAttributes(R.styleable.default_gallery);
>                         mGalleryItemBackground = a.getResourceId(
>                                         
> R.styleable.default_gallery_android_galleryItemBackground, 0);
>                         a.recycle();
>
> Then, within the getView(), apply the background:
>
>                         
> imageView.setBackgroundResource(mGalleryItemBackground);
>
> I hope this helps someone.

Thank, lilbyrdie. It helped me a lot :)

The thing is I'm still getting an error in function
obtainStyledAttributes, where the compiler says that
obtainStyledAttributes(int[]) is undefined.
I have that class extending BaseAdapter. What am I missing? Should I
be implementing an Interface or something?

Thanks!
Yaiza.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to