Damiancioo
Damiancioo

Reputation: 560

Unable to open Activity for ACTION_APP_LOCALE_SETTINGS

I'm trying to open new App locale settings screen introduced in Tiramisu (Android 13 - Api33)

I'm using current emulator (REVISION 6) of Androd 13, and with that when trying to open it with

override fun openAppLocaleSettings(activity: Activity) {
        activity.startActivity(
            Intent(Settings.ACTION_APP_LOCALE_SETTINGS, Uri.parse(context.packageName))
        )
    }

I'm getting

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.APP_LOCALE_SETTINGS dat= }

Is there something wrong with above code, or maybe it is not implemented yet by Android?

Upvotes: 3

Views: 737

Answers (1)

Damiancioo
Damiancioo

Reputation: 560

I was missing package scheme for uri, e.x. it should be package:your.package.name

activity.startActivity(
            Intent(Settings.ACTION_APP_LOCALE_SETTINGS, Uri.parse("package:your_package_name"))
        )

Upvotes: 8

Related Questions