Reputation: 632
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.
Upvotes: 0
Views: 631
Reputation: 632
The solution is to add
startActivityForResult(new Intent(Settings.ACTION_LOCALE_SETTINGS),0);
to your button's function or OnClick event.
Upvotes: 1
Reputation: 802
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);
Upvotes: 0