10

I want to open (start) activity named: "Language and input", where the user can change the device language.

startActivity(new Intent(Locale....));

It's in the Locale or... settings? Where is it?

Zbarcea Christian
  • 9,367
  • 22
  • 84
  • 137
  • I think this is answered here: http://stackoverflow.com/questions/2596352/change-language-settings-locale-for-the-device – alvi Aug 10 '13 at 14:35
  • Possible duplicate of [Change language settings (locale) for the device](https://stackoverflow.com/questions/2596352/change-language-settings-locale-for-the-device) – Sufian Jun 02 '17 at 06:55

4 Answers4

11

try this:

Intent intent = new Intent();
intent.setComponent( new ComponentName("com.android.settings","com.android.settings.Settings$InputMethodAndLanguageSettingsActivity" ));
startActivity(intent);
Iamat8
  • 3,888
  • 9
  • 25
  • 35
Satur6ay
  • 121
  • 2
  • 2
  • Please provide more explanation about how your code does solve the problem. – Martin Verjans Apr 22 '16 at 09:49
  • 4
    Note that for Android 8.0 (Oreo, API Level 26) this will throw ActivityNotFoundException. Instead, try using `com.android.settings.Settings$LanguageAndInputSettingsActivity`. – Yoav Feuerstein Oct 16 '17 at 11:06
8

try this

Intent intent=new Intent(android.provider.Settings.ACTION_INPUT_METHOD_SETTINGS);
startActivity(intent);
Aziz Shaikh
  • 16,245
  • 11
  • 62
  • 79
Ammad12
  • 105
  • 1
  • 2
6

Use this for open language and settings..

Intent i = new Intent(android.provider.Settings.ACTION_LOCALE_SETTINGS);
startActivity(i);

it will work

kalyan pvs
  • 14,486
  • 4
  • 41
  • 59
  • "Language and Input" activity, using android.provider.Settings.ACTION_INPUT_METHOD_SETTINGS – heMac Dec 12 '13 at 02:25
  • Is it possible to limit the languages shown there to specific languages that the application provides the translation only? – HendraWD Jul 15 '19 at 03:12
2

As an alternative answer, you can use this:

startActivityForResult(new Intent(Settings.ACTION_LOCALE_SETTINGS), 0);

It will bring you to the system language menu. Or:

startActivityForResult(new Intent(Settings.ACTION_INPUT_METHOD_SETTINGS), 0);

For keyboards and inputs. When the user hits the back button, it will return to your app.

A P
  • 2,131
  • 2
  • 24
  • 36