Guest User

Untitled

a guest
Aug 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. if (mResource != 0) {
  2. try {
  3. d = mContext.getDrawable(mResource);
  4. } catch (Exception e) {
  5. Log.w(LOG_TAG, "Unable to find resource: " + mResource, e);
  6. // Don't try again.
  7. mResource = 0;
  8. }
  9. }
  10.  
  11. //First set your original image tag...
  12. ImageView original; //The original ImageVew
  13. Integer resId = R.drawable.resource; //The original resource
  14. original.setTag(resId); //Add your resource id to the tag
  15.  
  16. //Then, to get the resource id...
  17. Integer resId = original.getTag();
Add Comment
Please, Sign In to add comment