Thanks for htbest2000, your solution works well.

On Jul 6, 3:58 pm, htbest2000 <[email protected]> wrote:
> you can take the following 2 step:
>
> step 1. append file attars.xml in res/values with content:
>
> <resources>
>     <declare-styleable name="Gallery">
>         <attr name="android:galleryItemBackground">
>         </attr>
>     </declare-styleable>
> </resources>
>
> step 2. modify the code from
>
>     public ImageAdapter(Context c) {
>         mContext = c;
>         TypedArray a = obtainStyledAttributes
> (android.R.styleable.Theme);
>         mGalleryItemBackground = a.getResourceId(
>                 android.R.styleable.Theme_galleryItemBackground, 0);
>         a.recycle();
>     }
>
> to
>
>     public ImageAdapter(Context c) {
>         mContext = c;
>         TypedArray a = obtainStyledAttributes(R.styleable.Gallery);
>         mGalleryItemBackground = a.getResourceId(
>                 R.styleable.Gallery_android_galleryItemBackground, 0);
>         a.recycle();
>     }
>
> On Jun 12, 1:18 am, ls86 <[email protected]> wrote:
>
> > hi,
>
> > I have just installed android 1.5 and  finished trying out the "Hello
> > Android" example.
> > I am now trying out thegalleryexample and I think I am stuck.I
> > pretty much copy pasted the code in the example - changing only the
> > names of the images.
>
> > I am facing a problem in the ImageAdapter class where I am getting a
> > compile time error
>
> > android.R.styleablecan not be resolved.
>
> > I googled and it turns out that other newcomers have also faced this
> > problem.
>
> > I found this threadhttp://forum.xda-developers.com/showthread.php?p=3861872
> > here someone has suggested removing "android" and using just,
> > "R.styleable"
>
> > I tried this too and it doesnt seem to work.
>
> > If someone has faced this problem before and knows how to deal with it
> > or can point me to some useful references, I would really appreciate
> > it.
>
> > Thanks
> > -ls
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to