Is there a way to change ImageView drawable with its corresponding drawable for landscape mode without destroying the whole activity. I tried to set the drawable again in onConfigurationChanged callback but it doesn’t work. Something like this
@Override
public void onConfigurationChanged(Configuration conf) {
super.onConfigurationChanged(conf);
mImageView.setImageDrawable(getResources().getDrawable(R.drawable.iv));
}
When i star the activity in landscape mode to correct drawable is displayed so resources are located correctly.
In your sample project just replace
with
I guess setBackgroundResource does nothing because the same resource is already assigned to ImageView.
Take a look at this
http://open-pim.com/tmp/ImageTest.zip
I tried your approach and it works just great for me.