繁体   English   中英

如何从我的Android应用程序隐藏Android桌面上的其他应用程序快捷方式图标

[英]How to hide other application Shortcut icons on android desktop from my android application

我正处于开发我的Android应用程序的最后阶段,我剩下的就是用我的应用程序隐藏手机桌面上的所有其他应用程序图标。 现在我在这里找到了这个代码,我试图修改它,甚至添加适当的权限,但似乎没有得到所需的结果。 请帮我修改它或建议我如何修改它来做我想要的。 这是代码

Intent myLauncherIntent = new Intent();
myLauncherIntent.setClassName("your.package.name", "YourLauncherActivityName");
myLauncherIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

Intent intent = new Intent();
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, myLauncherIntent);
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "Application Name");
intent.putExtra
   (
    Intent.EXTRA_SHORTCUT_ICON_RESOURCE,
    Intent.ShortcutIconResource.fromContext
                                (
                                     getApplicationContext(), 
                                     R.drawable.app_icon
                                )
   );
intent.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
getApplicationContext().sendBroadcast(intent);

我很感激能得到的所有帮助。 干杯伙计们。

我剩下的就是用我的应用程序隐藏手机桌面上的所有其他应用程序图标。

幸运的是,这是不可能的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM