Skip to content

Specify an excplicit package name to intent(s) #100

@stdStudent

Description

@stdStudent

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions