
从开发人员的角度来看,我想知道是否可以在我自己的应用程序中防止这种情况.是否有清单设置或其他告诉Google不要在安装时为我的应用程序创建图标?
没有启动器活动不是我的应用程序的选项.
解决方法 http://viralpatel.net/blogs/android-install-uninstall-shortcut-example/本教程对于在主页上添加或删除快捷方式非常有用
从主屏幕卸载快捷方式
类似于AndroID中的安装,卸载或删除快捷方式,使用Intent(UNINSTALL_SHORTCUT)来执行该任务.在下面的代码中,我们删除在主屏幕上添加的快捷方式.
再次,我们需要一个权限来执行卸载快捷方式任务.添加以下权限到AndroID清单xml.
private voID removeShortcut(){
//Deleting shortcut for MainActivity //on Home screen Intent shortcutIntent = new Intent(getApplicationContext(),MainActivity.class); shortcutIntent.setAction(Intent.ACTION_MAIN); Intent addIntent = new Intent(); addIntent .putExtra(Intent.EXTRA_SHORTCUT_INTENT,shortcutIntent); addIntent.putExtra(Intent.EXTRA_SHORTCUT_name,"HelloWorldShortcut"); addIntent .setAction("com.androID.launcher.action.UNINSTALL_SHORTCUT"); getApplicationContext().sendbroadcast(addIntent);} 总结 以上是内存溢出为你收集整理的android – 可以防止Google Play应用程序在安装时创建我的应用的快捷方式吗?全部内容,希望文章能够帮你解决android – 可以防止Google Play应用程序在安装时创建我的应用的快捷方式吗?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)