问题
I am creating a home application and I finally got it to host widgets. The only problem is that when I change the orientation of the phone the widgets disappear and I have to add them all over again. I know that activities are recreated when the orientation changes but what should I do for the widgets to show up again?
回答1:
Setting the background of an Activity
See my answer there. Just do not write anything in the onConfigurationChanged()
method.
This is caused because the orintation changes restarts your activity.
来源:https://stackoverflow.com/questions/6851638/problem-with-widgets-and-orientation-in-home-application