I have an activity in a floating window. When I press the On-ScreenButton for "Recent Apps", the activity is stopped but not destroyed. If I press the minimized app symbol, the system calls onRestart(), onStart() and onResume() but now the window is somewhat smaller than before and some of the content is truncated.
The reason for this may be the "SmallApps" Widget, which is started by the phone (Sony XPeria Z1, Lollipop) and also claims some screen space.
However, if I explicitly finish the app and start it from "Recent Apps", the activity is newly created and the window gets the correct size during the layout process based on its children's contents.
How do I invalidate the whole window?
I thought about saving the window size and resizing it (if necessary) in onRestart():
getWindow().setLayout(width,height)
but I would rather invalidate() the whole window and let it compute its size own its own (Just like calling setContentView() in onCreate())
What's the correct way to do that?
Aucun commentaire:
Enregistrer un commentaire