How to Empty ImageView from Android

Asked 2 years ago, Updated 2 years ago, 30 views

I want to remove the image in the image view when a button is pressed while displaying the image view.

mPhotoView.invalidate();
mPhotoView.setImageBitmap(null);

I tried it like this, but it didn't work. How shall I do it?

android

2022-09-22 15:26

1 Answers

mPhotoView.setImageResource(0); mPhotoView.setImageResource(android.R.color.transparent);Try this.


2022-09-22 15:26

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.