Just thought I'd check in and see if anyone had any suggestions for how to work around the following issue.
Cheers, Mike On Jul 17, 12:40 pm, Michael Burton <[email protected]> wrote: > I would like to create a Provider that can provide a particular string > based on the value of an Annotation. > > In particular (since I'm using Android), I would like to do something > like the following: > > @Inject > public void setString( @StringResource(R.string.foobar) String foobar) > { ... } > > If you're not familiar with Android, R.string.foobar is an int value > generated at compile time as part of the android build process. It's > a unique integer that you can use to call into a Resouce object in > order to retrieve the corresponding String. > > I see some conversations in the google group from 2007 regarding > various hacky ways to do this, and some suggestions that a less hacky > way is imminent, but I don't see any actual solutions yet. > > Is there a way my provider can obtain the value of the resource in > order to determine which String to inject? > > Cheers, > Mike > > PS. > seehttp://groups.google.com/group/google-guice/browse_thread/thread/24f0... > andhttp://code.google.com/p/google-guice/issues/detail?id=27for > related conversations I've found so far. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "google-guice" 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/google-guice?hl=en -~----------~----~----~----~------~----~------~--~---
