有啥子办法让 android 4.4 用 apk 安装完之后自动在桌面上显示图标?

2015-03-28 20:54:27 +08:00
 pig1983
RT ,谢
7188 次点击
所在节点    Android
8 条回复
jacy
2015-03-28 21:13:59 +08:00
写个app监听新安装的程序,然后在桌面建快捷方式
xcv58
2015-03-28 22:02:03 +08:00
要不换个 Launcher ? 这也是我不愿意用原生 Android 的原因之一。
wwqgtxx
2015-03-28 23:39:53 +08:00
用miui把,或者装一个软件叫《小米系统》就行了
虽然我自己在用华为官方的emui3.0
little_cup
2015-03-28 23:53:40 +08:00
如果是类似 iOS 式的图标全放桌面上的话,推荐 @renzhn 的冷桌面: http://coolapk.com/apk/net.ohrz.coldlauncher
cst4you
2015-03-29 04:31:11 +08:00
Google Play 有个选项安装时候添加到 Launcher 的桌面上.
如果你想寻找自动功能的话应该没有.
QQ 都要第一次启动才能加了.
also24
2015-03-29 09:20:19 +08:00
nova 自带这个功能。。
iislong
2015-03-29 10:46:18 +08:00
添加那么多快捷方式干吗?找程序搜索不是挺方便的吗?
duanyu47
2015-03-29 13:36:02 +08:00
Intent intent = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.app_name));
// 是否添加多个shortcut。false为否,true为是
intent.putExtra("duplicate", false);

Intent intent2 = new Intent(Intent.ACTION_MAIN);
intent2.addCategory(Intent.CATEGORY_LAUNCHER);
// 删除的应用程序的ComponentName,即应用程序包名+activity的名字
intent2.setComponent(new ComponentName(this.getPackageName(), this.getPackageName() + ".Main"));

intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, intent2);
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource.fromContext(this,
R.drawable.icon));
sendBroadcast(intent);
在manifest添加权限:

<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/180000

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX