I have been trying to get this to work for ages, being new at android
I thought I had made a mess of something on the install.
However, I did get it to work by doing the following:
[code]
public ImageAdapter(Context c) {
mContext = c;
TypedArray a = obtainStyledAttributes
(R.styleable.Gallery1);
mGalleryItemBackground = a.getResourceId
(R.styleable.Gallery1_android_galleryItemBackground, 0);
a.recycle();
}
[/code]
However, you have to add the file: attrs.xml to your 'values'
directory. This file can be found in the sdk you download in the
equivalent directory.
ice.
On Mar 29, 4:51 pm, Jonathan <[email protected]> wrote:
> Yes, it seems 'styleable' got removed from the SDK and the tutorial(s)
> hasn't been updated. There
> was a message a couple weeks ago about this and I'm trying to see if I
> can figure out what Dianne Hackborn
> means by "use <declare-styleable> in your own app". to fix this.
>
> On Mar 23, 12:30 pm, ppmoore <[email protected]> wrote:
>
> > Hello,
>
> > I've been following the View tutorials included in the android
> > developer site. When testing hteHelloGalleryview, I get this compile-
> > time error.
>
> > I searched for this error on this group but is wasn't answered.
> > Can anyone help.
>
> > The problem reference occurs in the imageAdapter class that is
> > appended after the onCreate() method in theHelloGalleryclass:
>
> > public class ImageAdapter extends BaseAdapter
> > {
> > ...
> > TypedArray a = obtainStyledAttributes
> > (android.R.styleable.Theme);
> > }
>
> > Strangely enough, when I insert this lines into the onCreate() method
> > at the start of the package, there is no problem. It seems that the
> > android.R class is not known.
>
> > Thanks,
> > Paul
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---