can i know if my app can start an activity?

Viewed 10

since Android 10, there are restrictions on starting activity:

https://developer.android.com/guide/components/activities/background-starts

is there a way to know if my app can start an activity or need to display a notification?

my tests only show logcat message ActivityTaskManager: Background activity start

but there is no exception thrown...

is there a way to programmaticaly know if i can start an activity?

1 Answers

If you want to start activity from background you need to ask permission of <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

It's runtime permission so user needs to allow it.

Try this it worked for me!

Related