0

How can I make my app lead to the Phone settings more specific - to the Language settings when a button is clicked ?

I have got the button in an xml and everything ready but I do not know what to write in MainActivity.java to make it lead to the Settings.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Valentin Filyov
  • 632
  • 7
  • 16
  • Possible duplicate of [How to start activity Language and input](https://stackoverflow.com/questions/18162873/how-to-start-activity-language-and-input) – Yoav Feuerstein Oct 16 '17 at 10:36

2 Answers2

1

The solution is to add

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

to your button's function or OnClick event.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Valentin Filyov
  • 632
  • 7
  • 16
0

You can use this in your onClick event (it takes you directly to the Language & Input settings page your Android device:

    Intent intent = new Intent();
    intent.setClassName("com.android.settings", "com.android.settings.Settings$InputMethodAndLanguageSettingsActivity");
    startActivity(intent);
edant92
  • 694
  • 8
  • 18
  • 1
    Just a note: Valentin's answer below takes you directly to the device language selection screen whereas mine takes you to the Language and Input screen with all the options. – edant92 Sep 16 '16 at 21:09