I think i’m getting closer but still getting resource errors with this. I have an image file named rock.png in all 3 drawable folders.
in my layout MAIN.XML:
<ImageView android:id="@+id/rockId" android:src="@drawable/rock"></ImageView>
In my code:
int resID = getResources().getIdentifier("rockId" , "id", "com.testing");
ImageView image = (ImageView) findViewById(resID);
I’m still seeing this in my error catlog:
10-30 17:36:24.485: WARN/ResourceType(74): Resources don't contain package for resource number 0x7f020000
Any thoughts on what I might be doing wrong? Any tips welcome
to find the control:
To dynamicly load an image from drawable i use this function
this will return the id of your drawable, now all you need to to is set the image in the control: