From af6bd9fe6d94fc7b3834602fcd643916f1c923ae Mon Sep 17 00:00:00 2001 From: Clark Scheff Date: Tue, 28 Oct 2014 15:43:02 -0700 Subject: Launch theme chooser that supports cyngn.intent.category.APP_THEMES If no activity is found that matches the intent with that category we will launch the theme settings. Change-Id: I6c210ff2f38c58a76719cd8625955026fdd6daa0 --- src/com/android/launcher3/Launcher.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/com/android/launcher3/Launcher.java') diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index d56eda564..1d1208f94 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1327,9 +1327,16 @@ public class Launcher extends Activity } protected void startThemeSettings() { - Intent settings = new Intent().setClassName(OverviewSettingsPanel.ANDROID_SETTINGS, - OverviewSettingsPanel.THEME_SETTINGS); - startActivity(settings); + Intent chooser = new Intent(Intent.ACTION_MAIN) + .addCategory(OverviewSettingsPanel.THEME_CHOOSER_CATEGORY) + .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + try { + startActivity(chooser); + } catch (ActivityNotFoundException e) { + Intent settings = new Intent().setClassName(OverviewSettingsPanel.ANDROID_SETTINGS, + OverviewSettingsPanel.THEME_SETTINGS); + startActivity(settings); + } if (mWorkspace.isInOverviewMode()) { mWorkspace.exitOverviewMode(false); -- cgit v1.2.3