APP生成桌面快捷方式
来源:互联网 发布:中医人工智能系统 编辑:程序博客网 时间:2024/05/22 17:01
在启动页oncreate()方法通过发送广播给桌面可创建快捷方式
//从sharepreference检查是否创建过boolean isInstalled = SpUtil.getBoolean(getApplicationContext(), Constacts.SHORTCUT, false); if (!isInstalled) { Intent intent = new Intent(); intent.setAction("com.android.launcher.action.INSTALL_SHORTCUT"); intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "应用名称"); intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher));//The name of the extra used to define the icon, as a Bitmap, of a shortcut. Intent startIntent = new Intent(); startIntent.setAction("android.intent.action.MAIN"); startIntent.addCategory("android.intent.category.LAUNCHER"); startIntent.addCategory("android.intent.category.DEFAULT"); startIntent.addCategory("android.intent.category.TAB"); intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, startIntent); sendBroadcast(intent); //已创建,添加到sharepreference SpUtil.putBoolean(getApplicationContext(), Constacts.SHORTCUT, true);
0 0
- APP生成桌面快捷方式
- App添加桌面快捷方式
- 创建APP桌面快捷方式?
- 为我们的安卓app自动生成桌面快捷方式
- vbs 生成桌面快捷方式
- Android生成桌面快捷方式
- 给app添加桌面快捷方式
- iOS App创建桌面快捷方式
- iOS App创建桌面快捷方式
- iOS App创建桌面快捷方式
- Android之生成桌面快捷方式
- 为Activity生成桌面快捷方式
- android 生成桌面快捷方式实例
- Ubuntu下生成桌面快捷方式
- php生成网页桌面快捷方式
- Android之生成桌面快捷方式
- php生成网页桌面快捷方式
- 为Activity生成桌面快捷方式
- 数据结构哈弗曼树
- java程序员从笨鸟到菜鸟之(七)一—java数据库操作
- 线索二叉树
- 1013. 数素数 (20)
- Java程序员从笨鸟到菜鸟之(八)反射和代理机制
- APP生成桌面快捷方式
- Laplace-Beltrami operator的理解
- Unable to find the ncurses libraries的解决办法
- win10下搭建汇编开发环境
- Java程序员从笨鸟到菜鸟之(九)——数据库有关知识补充(事务、视图、索引、存储过程)
- buct oj 最大公共子序列问题
- JAVA后端学习路线
- Java程序员从笨鸟到菜鸟之(十)枚举,泛型详解
- KMP算法