简体   繁体   English

通过Playstore生成的图标启动器正在Android 4.4上重新启动我的应用

[英]Icon launcher generated via Playstore is restarting my app on Android 4.4

i have an strange issue, 我有一个奇怪的问题,

My Icon launcher generated via Plays Store installation is restarting my app, it happens when my app is in background, however my Icon launcher inside my "Apps" sections just open the application on a normal way. 通过Play商店安装生成的“我的图标”启动器正在重新启动我的应用,当我的应用在后台运行时会发生这种情况,但是“应用”部分中的“我的图标”启动器只是以常规方式打开了该应用。

this only happen with my signed app downloaded from Playstore, what would be the reason for that restarting caused by the Play Store´s icon launcher? 这仅发生在我从Playstore下载的已签名应用程序中发生的情况,这是由Play Store的图标启动器引起的重新启动的原因是什么?

I have realized it only happens with Android 4.4 "Kit Kat" 我已经意识到只有在Android 4.4“ Kit Kat”中才会发生这种情况

this is my AndroidManifest.xml : 这是我的AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.jorgesys.news"
    android:versionCode="41"
    android:versionName="2.7.7" >

    <uses-sdk
        android:minSdkVersion="9"
        android:targetSdkVersion="19" />


    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />


    <uses-feature
        android:name="android.hardware.microphone"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.telephony"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.bluetooth"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.camera"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.location.gps"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.wifi"
        android:required="false" />

    <application
        android:name="com.jorgesys.news.MyApplication"
        android:allowBackup="false"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:theme="@style/AppBaseTheme" >
       <activity
            android:name="com.jorgesys.news.MainActivity"
            android:label="Jorgesys"
            android:launchMode="singleTask"
            android:windowSoftInputMode="adjustPan"
            android:configChanges="keyboardHidden|orientation|screenSize">
            <meta-data
                android:name="android.app.default_searchable"
                android:value="com.jorgesys.news.activities.SearchableActivity" />
        </activity>


     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

    </application>

</manifest>

hoping to have some help from the experts! 希望能得到专家的帮助! thanks in advance! 提前致谢!

You might have stumbled upon an known issue in Android. 您可能偶然发现了Android中的一个已知问题。 Issues: 2373 , 5277 问题: 23735277

Here is a fix you can try from a similar question that got more attention: 这是一个解决方法,您可以尝试从引起更多关注的类似问题中尝试解决:

if (!isTaskRoot()
            && getIntent().hasCategory(Intent.CATEGORY_LAUNCHER)
            && getIntent().getAction() != null
            && getIntent().getAction().equals(Intent.ACTION_MAIN)) {

        finish();
        return;
    }

If this instance is opened by the launcher but it's not the root of the task (you have other activities open) then closing it should bring up the last open activity. 如果启动器打开了该实例,但它不是任务的根(您有其他活动处于打开状态),那么关闭它应该会显示上一个打开的活动。

You can also try researching this solution 您也可以尝试研究此解决方案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM