My MainActivity essentially shows two ImageViews. In order to make sure that the Bitmaps in the ImageViews are shown under all circumstances I do the following in the onResume method of MainActivity: load the Bitmaps bmp from preferences and assign them with
iView.setImageBitmap(bmp).
This works well after returning from another activity or when the user switches to another app and comes back to my app. But it does NOT work, when my app is on top of the screen, when the user switches off the device and turns it on again later. That is rather strange, since I explicitely load the Bitmaps from preferences and assign them again in onResume. This is also true for the latest devices e.g. the S7. Any advice highly appreciated!
It turned out that I had to do the assignment of the Bitmap via
iView.setImageBitmap(bmp)
already in the onCreate method. I assume that some layout inflation tasks are performed more thoroughly within onCreate than anywhere else. At least in the case of the turn off/on story this seems to be true.