0

When clicking on a Firebase dynamic link in another application (my application is not started), my application will open on top of that app. When I close the app, my app is not being closed properly. I clicked on my app icon, my app back to the foreground. However, I can't see my app on the recent app list and therefore can't close it.

1) Any way to close my app properly? How to handle that? 2) I have already set the launch mode to singleTask. Why is it still open on top of another app when my app is not in the background (closed)? I expected it to start a new task, which I able to close both apps separately. * I tested on pre lollipop Android version

AndroidManifest

    <!-- App Activities -->
    <activity
        android:name=".activity.SplashActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.NoActionBar"
        android:launchMode="singleTask"
        android:taskAffinity="">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <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.xxx.com" android:scheme="https"/>
        </intent-filter>
    </activity>
    <activity
        android:name=".activity.MainActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.statusBarNoActionBar" />
Clive Teow
  • 115
  • 2
  • 8

1 Answers1

0

This solution works for me. Please try to add on activity

override fun onStop() {
    super.onStop()
}

override fun onUserLeaveHint() {
    super.onUserLeaveHint()
    this.onStop()
}
Nimisha V
  • 461
  • 4
  • 12