Android之添加固定图标到桌面
生活随笔
收集整理的這篇文章主要介紹了
Android之添加固定图标到桌面
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
我的QQ群
1 需求
Android之添加固定圖標到桌面
2 部分實現
在AndroidManifest.xml里面添加如下權限
<uses-permission android:name="com.android.launcher.permission.READ_SETTINGS" /><uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" /> fun addShortCutCompact(ct: Context?): Boolean {val context = ct ?: BaseApp.getInstance().contextif (ShortcutManagerCompat.isRequestPinShortcutSupported(context)) {val shortcutInfoIntent = Intent(context, MainActivity::class.java)shortcutInfoIntent.putExtra(MainActivity.INTENT_PARAM_MODE, MainActivity.INTENT_PARAM_MODE)總結
以上是生活随笔為你收集整理的Android之添加固定图标到桌面的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android之设置当前app为默认浏览
- 下一篇: Android之解决卸载app后再次安装