I have the following problem:
suppose that until now, I am using R.drawable.img to set the image in some imageviews with
imgView.setImage(aProduct.getImgId());
the simplified product class look like this:
class Product{
int imgId;
....
public void setImgId(int id){
this.imgId=id;
}
public int getImgId(){
return this.imgId
}
...
}
my application is now "evolved" because the user can add customized products taking the img from the camera and getting the Uri of the picture. and to set the image on the ImageView imgView.setImgURI(Uri)
Now my question is: what would be the best approach to have a mixed int/Uri image resources ambient? can I obtain the Uri of a "R.drawable.img"?
I'm not sure if my question is clear, I mean:
I have to check, before to set the imageview, if my product has an Uri or an int Id, and then make an "if" to call the appropriate method, or there is a simpler solution?
Thank you for reading, and sorry for my english.
Regards.