Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Settings LocalePicker on Honeycomb
    primarykey
    data
    text
    <p>I am implementing an app that uses the native language settings which can be accessed from: Menu > Settings > Language &amp; Keyboard > Select Language > Locale</p> <p>I can also open the Locale page directly using an intent which lists the languages by using the following code:</p> <pre><code>Intent languageIntent = new Intent(Intent.ACTION_MAIN); languageIntent.setClassName("com.android.settings", "com.android.settings.LocalePicker"); activity.startActivity(languageIntent); </code></pre> <p>^-- code credit: <a href="https://stackoverflow.com/questions/2596352/android-change-language-settings-locale-for-the-device/2596497#2596497">Change language settings (locale) for the device</a></p> <p>This works great on versions before Honeycomb. However the settings for Honeycomb has the little navigation area off to the left, like so: </p> <p><img src="https://i.stack.imgur.com/o8Kg7.png" alt="Image"></p> <p>and when i execute the above code I get this error:</p> <pre><code>Starting: Intent { act=android.intent.action.MAIN cmp=com.android.settings/.LocalePicker } from pid 24294 FATAL EXCEPTION: main android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.settings/com.android.settings.LocalePicker}; have you declared this activity in your AndroidManifest.xml? </code></pre> <p>Any idea why this is happening? If i change "com.android.settings.LocalePicker" to "com.android.settings.Settings" it will open up the settings page to whatever setting you had last selected but if i try to change the classname to something like: "com.android.settings.Settings.LocalePicker" it blows up again. Here is some modified code which I'm using until this issue is resolved:</p> <pre><code>Intent languageIntent = new Intent(Intent.ACTION_MAIN); int currentApiVersion = android.os.Build.VERSION.SDK_INT; final int HONEYCOMB = 11; if (currentApiVersion &lt; HONEYCOMB) // "HONEYCOMB" should be replaced with android.os.Build.VERSION_CODES.HONEYCOMB, but version code 'honeycomb' is not supported... { languageIntent.setClassName("com.android.settings", "com.android.settings.LocalePicker"); } else { languageIntent.setClassName("com.android.settings", "com.android.settings.Settings"); } activity.startActivityForResult(languageIntent, WtgActivity.LANGUAGE_CHANGE_REQUEST); </code></pre> <p>Running code that does something different based on version number is not ideal, so if anyone knows how to fix this i would appreciate it.</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload