Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open Home Launcher List settings screen programmatically in Android using Intent

I am looking for a way to open a Launcher list screen in Home option in system Settings using Intent.

main system Settings >> Home >> Launcher List.

I need to open this Launcher list screen using Intent. If anyone could point me in the right direction I would really appreciate it. Thanks much.

like image 294
Jadav Nirav Avatar asked May 10 '16 22:05

Jadav Nirav


1 Answers

To bring up the home screen settings page, call the Settings.ACTION_HOME_SETTINGS intent. However this is ONLY supported in API 21 and above.

API 20 and below need to call the Settings.ACTION_SETTINGS intent, and the user must navigate the rest of the way. (Preferably with instructions before hand)

To provide the best intent when available, use the following code. This will open the home settings directly on API 21 and above, else it will open the settings page on API 20 and below.

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
    final Intent intent = new Intent(Settings.ACTION_HOME_SETTINGS);
    startActivity(intent);
}
else {
    final Intent intent = new Intent(Settings.ACTION_SETTINGS);
    startActivity(intent);
}
like image 63
IAmGroot Avatar answered Sep 20 '22 01:09

IAmGroot