I'm currently creating a payment SDK for android, as such I want to send some images from the sdk/library project to the actual application based on different situations. I want the users of the application to use the drawables, but I dont want them to set it manually(i.e get it directly from the SDK's drawable folder), the SDK should automatically choose what image to use based on difference situations.
Currently what I have is a DAO class which when initilized have something like:
case (MASTERCARD):
this._logo = getResources().getDrawable(R.drawable.mastercard_securecode);
and then in the application I want to be able to fetch that drawable and use it in an ImageView like this:
img.setImageDrawable(DAOObject.getLogo());
However when running this I get
06-15 20:25:18.933: W/dalvikvm(625): VFY: unable to resolve static field 6 (mastercard_securecode) in LPackagePath/R$drawable;
followed by a nullpointer exception as getLogo will return null due to the above error.
Anyone know how to implement this properly so I dont get the above errors and still be able to implement it this way where the application gets the drawable sent dynamically as such?
Any help is much appreciated!