Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Error accessing image from Android resource folder inside Titanium module

$
0
0

Hey guys,

I am trying to access an image inside my Titanium Android module. I placed the image named my_image.gif inside $APP_DIR/platform/android/res/drawable

Now inside module I have tried all three methods for finding Resource as follows:

int res_id = TiRHelper.getResource("android.R.drawable.my_image");
imageView.setImageResource(res_id);
int res_id = TiRHelper.getAndroidResource("drawable.my_image");
imageView.setImageResource(res_id);
int res_id = TiRHelper.getApplicationResource("android.R.drawable.my_image");
imageView.setImageResource(res_id);
However all three of them end up in ResourceNotFoundException

Also after building the application, when I check the build\android\res\drawable folder, I find that my_image is actually present there.

I don't understand what I am doing wrong here or what isn't working exactly. Can anyone please help me out?

Thanks


Viewing all articles
Browse latest Browse all 8068

Trending Articles