与小部件和方向在国内应用问题部件、在国内、方向、问题

由网友(こ不再与你纠缠)分享简介:我创建一个家庭的应用程序,我终于得到它承载部件。唯一的问题是,当我改变手机的小部件消失的方向,我必须重新添加所有。我知道,当方向变化,但我应该怎么办的小部件再次出现活动重现?I am creating a home application and I finally got it to host widgets....

我创建一个家庭的应用程序,我终于得到它承载部件。唯一的问题是,当我改变手机的小部件消失的方向,我必须重新添加所有。我知道,当方向变化,但我应该怎么办的小部件再次出现活动重现?

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?

推荐答案

设置背景一个活动的

请参阅我的答案在那里。只是不写在 onConfigurationChanged()方法什么。

See my answer there. Just do not write anything in the onConfigurationChanged() method.

这是造成的,因为在orintation变化重新启动您的活动。

This is caused because the orintation changes restarts your activity.

阅读全文

相关推荐

最新文章