的&QUOT意外恢复;包名称和QUOT;虽然已经恢复了“”包名和QUOT;在Android的错误 [英] Unexpected resume of "package name" while already resumed in ''package name" Error in Android
问题描述
如果改变我的手机或定向模拟器我得到了LogCat中下面的输出:
If changing the orientation of my phone or the emulator I get the following output in LogCat:
04-09 11:55:26.290: INFO/WindowManager(52): Setting rotation to 1, animFlags=0
04-09 11:55:26.300: INFO/ActivityManager(52): Config changed: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=2/1/1 nav=3/1 orien=2 layout=18}
04-09 11:55:26.460: INFO/UsageStats(52): Unexpected resume of client while already resumed in client
04-09 11:55:26.579: INFO/SearchPosition(807): Activity is paused
04-09 11:55:26.689: INFO/SearchPosition(807): Activity is resuming
SearchPosition是显示的活动。 活动暂停被写入的onPause方法和活性恢复在活动的onResume方法
SearchPosition is the activity that is displayed. Activity is paused is written in the onPause Method and Activity is resuming in the onResume method of the activity.
我GOOGLE了错误信息一点点,但我不完全理解它的含义。我想这可能意味着旧的活动不是适当改变屏幕的方向后销毁。
I googled a little bit for the error message but I don't fully understand the meaning of it. I think it could mean that the old Activity is not properly destroyed after changing the screen orientation.
这是正确的?如果是的话是什么原因造成的错误? 如果这是不正确?这是什么输出的意思?
Is this correct? If yes what causes the error? If this is not correct? What is the meaning of this output?
推荐答案
添加此进入活动声明你的manifest.xml
add this into the the activity declaration in your manifest.xml
机器人:configChanges =定向
例如:
<activity android:name=".MyApp" android:configChanges="orientation" android:label="@string/app_name">
的http://developer.android.com/intl/fr/guide/topics/manifest/activity-element.html#config
与QWERTY键盘的设备
for Devices with QWERTY keyboard
android:configChanges="keyboardHidden|orientation"
这篇关于的&QUOT意外恢复;包名称和QUOT;虽然已经恢复了“”包名和QUOT;在Android的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!