OK.  I'm not in an Activity though, I'm in the overlay class. You
can't call getResources() from there.  Also, I printed the resource id
to the log to verify that there is an actual value there.  It matches
the one in the R file.

On Jan 13, 9:47 pm, Lance Nanek <[email protected]> wrote:
> I don't see any field named target in android.R.drawable. Are you sure
> there is a system drawable resource with that name?
>
> If you are using your own package's R class, then you should be using
> your activity's resources. They are available via getResources() on
> the activity. Resources.getSystem() is for system resources.
>
> On Jan 13, 8:59 pm, Eric Crump <[email protected]> wrote:
>
>
>
> > I'm trying to set a resourse in the onTable method of my map overlay.
> > It throws a Resourses$NotFoundException.  I've also tried making it a
> > class variable and setting it from the MapView but I get the same
> > result.
>
> > @Override
> > public boolean onTap(GeoPoint gp, MapView mv)
> > {
> >         OverlayItem item = new OverlayItem(gp, "", "");
> >         Drawable  drawable = Resources.getSystem().getDrawable
> > (R.drawable.target);
> >         item.setMarker(altDrawable);
> >         addOverlay(item);
> >         return true;
>
> > }- 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 [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