简体   繁体   English

每次我点击主屏幕图标时,我的应用程序都会显示启动画面,而应用程序在后台

[英]My app show splash screen every time i tap home screen icon while app in background

I am developing an android app but there is a problem我正在开发一个 android 应用程序,但有一个问题

  • When I press home button from my device navigation when the app is show in the display it's gone background当应用程序显示在显示屏中时,当我从设备导航中按主页按钮时,它就消失了背景
  • but when I tap app icon from home screen then every time it shows splash screen first and then takes me to wherever(activity) I left last但是当我从主屏幕点击应用程序图标时,每次它首先显示闪屏然后带我到我最后离开的任何地方(活动)
  • if I start the app from the recent task then it doesn't show me splash screen and directly take me to wherever(activity) I left.如果我从最近的任务启动应用程序,那么它不会显示启动画面,而是直接将我带到我离开的任何地方(活动)。

here Manifest.xml这里 Manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.videowatermark.addtextandtimestampongalleryvideos">
    <!-- In App Billing permission -->
    <uses-permission android:name="com.android.vending.CHECK_LICENSE" />
    <uses-permission android:name="com.android.vending.BILLING" /> <!-- Network permission -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- Location Permisssion -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- Storage Permission -->
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- System Overlay Window -->
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <uses-permission android:name="android.permission.ACTION_MANAGE_OVERLAY_PERMISSION" /> <!-- Restart of Devcie -->
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <!-- Audio setting -->
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> <!-- Tell the system this app requires OpenGL ES 2.0. -->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <application
        android:name=".AutoStamperApplication"
        android:allowBackup="true"
        android:fullBackupContent="true"
        android:hardwareAccelerated="true"
        android:icon="@drawable/autologo"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:networkSecurityConfig="@xml/network_security_config"
        android:roundIcon="@drawable/autologo"
        android:theme="@style/AppTheme">

        <activity
            android:name=".Activity.StampedVideoListAct"
            android:label="@string/stamped_video"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme" />

        <service
            android:name=".services.StampOnVideoService"
            android:enabled="true"
            android:exported="true" />

        <uses-library
            android:name="org.apache.http.legacy"
            android:required="false" />

        <meta-data
            android:name="firebase_performance_collection_enabled"
            android:value="false" />
        <meta-data
            android:name="asset_statements"
            android:resource="@string/asset_statements" />
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="@string/Video_Gallery_Stamper_APP_ID" />
        <meta-data
            android:name="com.onesignal.NotificationOpened.DEFAULT"
            android:value="DISABLE" />

        <activity
            android:name=".Activity.AutoStamperActivity"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar"
            android:windowSoftInputMode="adjustResize" />
        <activity
            android:name=".Activity.InAppBillingActivity"
            android:label="@string/txt_inapp_title"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme" />
        <activity
            android:name="com.yalantis.ucrop.UCropActivity"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
        <activity
            android:name=".Activity.OfferActivity"
            android:label="@string/offer_activity"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme" />
        <activity
            android:name=".Activity.SplashScreenActivity"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:theme="@style/AppThemeNoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".Activity.InternalBrowserActivity"
            android:launchMode="singleTask"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="www.autostamper.us"
                    android:path="/about-us"
                    android:scheme="http" />
                <data
                    android:host="www.autostamper.us"
                    android:path="/terms-and-condition"
                    android:scheme="http" />
                <data
                    android:host="www.autostamper.us"
                    android:path="/privacy-policy"
                    android:scheme="http" />
                <data
                    android:host="www.autostamper.us"
                    android:path="/date-and-time-stamp"
                    android:scheme="http" />
                <data
                    android:host="www.autostamper.us"
                    android:path="/signature-stamp"
                    android:scheme="http" />
                <data
                    android:host="www.autostamper.us"
                    android:path="/gps"
                    android:scheme="http" />
                <data
                    android:host="www.autostamper.us"
                    android:path="/watermark-logo"
                    android:scheme="http" />
                <data
                    android:host="www.autostamper.us"
                    android:path="/*"
                    android:scheme="http" />
            </intent-filter>
        </activity>

        <service
            android:name=".services.VideoStampingService"
            android:icon="@drawable/ic_logo"
            android:label="@string/app_name"
            android:stopWithTask="false" />
    </application>

</manifest>

Please remove below line from your splash activity tag请从您的启动活动标签中删除以下行

android:launchMode="singleTask"
 <activity
            android:name=".Activity.SplashScreenActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppThemeNoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

暂无
暂无

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

相关问题 每次我 go 到主屏幕时,Android 都会杀死我的应用程序 - Android kills my app every time I go to home screen 如何在Android的主屏幕上的我的应用程序图标上显示通知计数 - How to show Notification Count on My App Icon on Home Screen in Android 如何在App上显示一次Splash Screen? - How to show one time Splash Screen on App? 每次单击主屏幕上的应用程序图标时,启动应用程序启动屏幕 - launch a app splash screen everytime we click a app icon from home screen 使用 eas build 构建我的应用程序时,启动画面和图标未更新 - splash screen and icon are not updated when building my app with eas build Android中应用程序处于后台时如何显示启动画面? - How to show splash screen when app is in background in Android? 仅在应用程序启动时显示启动画面,而不是每次调用包含启动画面代码的活动时显示启动画面 - Display splash screen only when the app is launched and not every time when the activity containing splash screen code, is called 如何更正我的Web应用程序初始屏幕代码,使其首先显示初始屏幕,然后移至主要活动? - How do I correct my web app splash screen code to show splash screen first and then move to the main activity? 为什么在每次打开应用程序时都显示此屏幕 - why this screen, while app opens every time 如何使应用程序图标在启动画面中居中? - How to center the app icon in splash screen?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM