Guest User

Untitled

a guest
Jun 27th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. /**
  2. * Displays an image, such as an icon.
  3. */
  4. public class ImageView extends View {
  5.  
  6. // Resource ID for the source image that should be displayed in the ImageView.
  7. private int mImageId;
  8.  
  9. // Context of the app
  10. private Context mContext;
  11.  
  12. /**
  13. * Constructs a new ImageView.
  14. */
  15. public ImageView(Context context) {
  16. mImageId = 0;
  17. mContext = context;
  18. }
  19.  
  20. /**
  21. * Sets the source image in the ImageView.
  22. *
  23. * @param imageId is the resource ID of the image to be displayed.
  24. */
  25. public void setImage(int imageId) {
  26. mImageId = imageId;
  27. }
  28. }
Add Comment
Please, Sign In to add comment