我有下面的代码,在android设备中工作完美,但不在 诺基亚-x

下面是示例代码:

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);

请帮助我在实现同样的事情 诺基亚-x

有帮助吗?

解决方案

如图所示,诺基亚X应用程序启动器不听广播,发射器的想法也比其他AOSP设备不同,并且不会看到设计非常适合快捷图标。

无论如何,Fastlane正在显示所有通知,因此如果要为任务进行快捷方式,那么使用诺基亚X您应该使用任务的通知。

其他提示

实际上诺基亚X没有主屏幕,它拥有的是应用程序启动器(瓷砖)。甚至通知窗格称为fastlane。您的代码适用于启动器上的主屏幕,如 Nova Launcher.即使我正在使用 Nova Launcher 在我的诺基亚X。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top