Unexpected resume of “package name” while already resumed in ''package name\" Error in Android

Deadly 提交于 2019-12-02 22:15:33
Jorgesys

Add this into the the activity declaration in your manifest.xml:

android:configChanges="orientation"

Example:

<activity android:name=".MyApp" android:configChanges="orientation" android:label="@string/app_name">

https://developer.android.com/guide/topics/manifest/activity-element.html#config

For Devices with QWERTY keyboard

android:configChanges="keyboardHidden|orientation"

Example usage of android:configChanges="orientation" in AdroidManifest.xml file:

 <activity android:name=".Sound"
            android:configChanges="orientation"
                  android:label="@string/app_name" android:debuggable="true" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

I stumbled here first and after I read the link provided by leventix in his comment I can't help but think that both of the answers are actually wrong. Then I found the earlier question 3851363 which is about the same issue. The message is benign.

Correct me if I'm wrong, but I understood that the config option android:configChanges="orientation" should only be used when you want to handle the config changes yourself and not go through the typical onDestroy/onCreate cycle.

The android-8 seems to spawn the error in question needlessly in normal circumstances when the orientation changes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!