How to Start an Activity from Background in Android 10

How to trigger a launch Activity intent when my app is closed on Android 10/Q?

As of Android 10 (API level 29), you cannot start activities from the background anymore.

There are a number of exceptions to this rule that may or may not apply to your given scenario.

If none of the exceptions apply, you might want to consider displaying a high-priority notification, possibly with a full-screen Intent.

How to open activity from background service's full screen intent notification Android

You can open activity from the background by adding "SYSTEM_ALERT_WINDOW" permission to the manifest and ask for user permission once when the app opened the first time by calling startActivity(new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION)); somewhere in your app and granting permission to your app.



Related Topics



Leave a reply



Submit