You can't do that in Java. R is not a hash but a static java file pre-generated. It contains a bunch of integer constants to reference your resources.
If you really need to access your resources dynamically, there's a way using strings but it's slower so it's not recommended. R/ On Tue, Dec 30, 2008 at 8:17 AM, myIP <[email protected]> wrote: > > As being a programmer from ActionScript, I am trying to use brackets > ( [ ] ) to reference an Object. In ActionScript the following is > syntactically correct: > > > //ActionScript > var currentIcon:Drawable = getResources().getDrawable( R > ["drawable"].icon ); > > //attempt in Java > Drawable currentIcon = getResources().getDrawable( R > ["drawable"].icon ); > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

