imageView1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view)
{
if(imageViewGet1.getDrawable() != null){
imageView1.setVisibility(View.INVISIBLE);
imageViewGet1.setVisibility(View.VISIBLE);
}
OpenGallery1();
}
});
imageView2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view)
{
if(imageViewGet2.getDrawable() != null){
imageView2.setVisibility(View.INVISIBLE);
imageViewGet2.setVisibility(View.VISIBLE);
}
OpenGallery2();
}
});
when I run the code and open galley to pick new photo, after that, the imageView with the old one still appear
how I can fix that so when I choose new image, the imageView1 disappear and imageViewGet appear with the new Image.
2
Answers
I tried this :
and it works fine.
try to use
if are views overlapping (one is in front of second).
just makes view invisible, but doesn’t hide it.
If this won’t help, you may can use
Shared Preferences
to storebool
with image (in)visibility state.