ImageView available:
<ImageView android:id="@+id/image" android:layout_width="match_parent" android:layout_height="wrap_content"/> In the code found it:
... ImageView imageView = (ImageView) findViewById(R.id.imgViewPreview); ... Further:
imageView.setImageURI(myUri); Ok, the image was displayed in the ImageView, but the problem is that I have to periodically change the image in this ImageView, causing the second time
imageView.setImageURI(myUriTwo); An old image remains in the ImageView. How to change the image in the ImageView?
UPD: Important note, in the imageView method setImageURI I pass the same link, i.e. the image is displayed for the first time, if all the norms, the image (jpg file) is modified by pressing the button, and the modified image must be displayed. I call the method a second time, with the same myUri (and not myUriTwo), the jpg image on the media was overwritten, and the ImageView remains the same.
Solved the problem like this:
imageView.setImageResource(0); imageView.setImageURI(myUri); Most likely the image is simply cached, but my solution to the problem is more like a crutch. Any ideas? Or leave it would be quite normal (PS learning to write correctly).