Question

I have below code which work perfect in android devices but not in Nokia-x

Here is the sample code:

Intent shortcutIntent = new Intent(getApplicationContext(), MainActivity.class);
                shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

                Intent addIntent = new Intent();
                addIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
                addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "Icon Test");
                addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource.fromContext(getApplicationContext(), R.drawable.ic_launcher));
                addIntent.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
                getApplicationContext().sendBroadcast(addIntent);

Please help me out in achieving same thing in Nokia-x

Was it helpful?

Solution

As already identified the Nokia X application launcher does not listen that broadcast, also the launcher idea is a bit different than with other AOSP devices, and would not see the design very well suited for shortcut icons.

anyway, the Fastlane is showing all notifications, thus if you want to make a shortcut to a task, then with Nokia X you should use the Notifications for the task.

OTHER TIPS

Actually Nokia X doesn't have home screen, what it has is app launcher(tiles). Even notifications pane known as fastlane. Your code works with home screen on launchers like Nova Launcher. Even I am using Nova Launcher on my Nokia X.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top