ProcessPhoenix icon indicating copy to clipboard operation
ProcessPhoenix copied to clipboard

Specify an excplicit package name to intent(s)

Open stdStudent opened this issue 1 year ago • 0 comments

For apps targeting Android 14 (API level 34) or higher <...>

  • <...>
  • If an app creates a mutable pending intent with an intent that doesn't specify a component or package, the system throws an exception.

Source: https://developer.android.com/about/versions/14/behavior-changes-14#safer-intents.

Right now I have to include the package name manually to an intent:

val myIntent = Intent(context, Class.forName("my.pkg.name.MyActivity")).apply {
    setPackage(context.packageName) // API 34+
}

ProcessPhoenix.triggerRebirth(context, myIntent)

stdStudent avatar Nov 14 '24 10:11 stdStudent