[android-developers] Re: Dynamically reading drawable file names

2010-12-19 Thread darrinps
I had the code in my start up (splash) activity, so yes it was in the proper (as far as I know of) Context. Yes, I did try to use the Resources.getSystem() verbatim. What normal Resources object are you referring to? In other words, if you cannot do: mResources = Resources.getSystem(); Then

[android-developers] Re: Dynamically reading drawable file names

2010-12-19 Thread String
On Sunday, December 19, 2010 10:19:57 PM UTC, darrinps wrote: Yes, I did try to use the Resources.getSystem() verbatim. What normal Resources object are you referring to? In other words, if you cannot do: mResources = Resources.getSystem(); Then what would be to the right of:

Re: [android-developers] Re: Dynamically reading drawable file names

2010-12-18 Thread Kostya Vasilyev
You can use Java reflection with your application's R.drawable class to build the list. -- Kostya Vasilyev -- http://kmansoft.wordpress.com 18.12.2010 8:30 пользователь darrinps darri...@gmail.com написал: What I am wanting to do is offer the user a list of image names and allow them to choose

Re: [android-developers] Re: Dynamically reading drawable file names

2010-12-18 Thread Dianne Hackborn
startPreloading() is not relevant to this; that is for the code there that is preloading the drawables it gets from the array. Is there actually a sym_def_app_icon drawable in your app? If not... well yeah, that won't work, it doesn't exist. You should just use the syntax I showed to make an

[android-developers] Re: Dynamically reading drawable file names

2010-12-18 Thread darrinps
This was just an example that fit the example you provided. I trimmed down the array to only one .png file which I verified time and again was under the drawable directory and reworked the layout of the file to match the example. The entire arrays.xml file which is found under the values

Re: [android-developers] Re: Dynamically reading drawable file names

2010-12-18 Thread Dianne Hackborn
I don't know what to say, the code I pointed to is exactly what has been in the platform fairly unchanged since 1.0 and has worked fine. Are you sure you are doing this on a Context that is actually for your application? The error message (Invalid package identifier) indicates it doesn't know

[android-developers] Re: Dynamically reading drawable file names

2010-12-17 Thread darrinps
Thanks. I tried doing that but it seems to be an old API so I tried to convert it to what is there today. There must be some mistake I have made that keeps this from working. Note that it didn't like mResources.startPreloading(); The method simply was not there, although finishPreloading() is.

[android-developers] Re: Dynamically reading drawable file names

2010-12-17 Thread darrinps
What I am wanting to do is offer the user a list of image names and allow them to choose one then display that image in another activity. On Dec 17, 10:42 pm, darrinps darri...@gmail.com wrote: Thanks.  I tried doing that but it seems to be an old API so I tried to convert it to what is

[android-developers] Re: Dynamically reading drawable file names

2010-12-13 Thread Brill Pappin
You can read your images from the assets directory. It's not the same as the res/drawable but you should still be able to read and use a Drawable (image) from assets. I'm not sure if you can scan assets though to look for new files (I could very well be wrong about that, as I haven't tried).

[android-developers] Re: Dynamically reading drawable file names

2010-12-12 Thread Bob Kerns
Well, it's not what you asked for (since drawables come from different directories) but it may be closer to what you are looking for. You can use Java reflection to find all the public fields in R.drawable. The drawable directory doesn't exist at runtime; the contents are packaged up into the