android创建桌面图标
来源:互联网 发布:百战天下坐骑进阶数据 编辑:程序博客网 时间:2024/05/01 19:32
private void setDeskShortCut() {boolean installedshortcut = sp.getBoolean("installedshortcut", false);if (installedshortcut) {return;}//创建一个快捷方式的意图Intent intent = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, //快捷方式的名称getString(R.string.app_name));intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, BitmapFactory.decodeResource(getResources(), R.drawable.mobilesafe_logo_s)); //快捷方式的图标//设置点击这个快捷方式,打开哪个activityIntent openMS = new Intent("com.hy.test.activities.home");openMS.addCategory("android.intent.category.DEFAULT");intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, openMS); //快捷方式的打开界面sendBroadcast(intent); //发送一个广播Editor editor = sp.edit();editor.putBoolean("installedshortcut", true);editor.commit();}
!!!添加权限:com.android.launcher.permission.INSTALL_SHORTCUT
0 0
- android创建桌面图标
- Android创建桌面图标
- 创建桌面图标和删除桌面图标 android
- 创建android应用程序的桌面图标
- android 创建桌面图标,luncher图标
- Ubuntu创建android studio桌面图标
- android create desktop icon(创建桌面图标)
- 创建桌面图标
- Android开发 创建桌面图标和widget的示例
- 创建显示桌面图标
- ubuntu创建eclipse桌面图标
- linux 下创建桌面图标
- 3.ubuntu 创建桌面图标
- 默认创建两个桌面图标
- Ubuntu创建应用程序桌面图标
- Ubuntu 创建桌面图标
- 创建Ubuntu桌面图标
- 使android桌面图标变大
- Android--线程池实现方式解析
- 指针,和指针的引用
- UVa 437 - The Tower of Babylon(DAG动态规划)
- 向iOS进军(3): Info.plist含义详解
- 程序员软件项目预估的宝贵经验
- android创建桌面图标
- Jquery 操作获取 radio选中值
- neutron-l3-agent
- Android之IntentService搭配LocalBroadcast
- 关于while (!Thread.currentThread().isInterrupted()){}的意思
- HTML,CSS,font-family:中文字体的英文名称 (宋体 微软雅黑)
- 基于sae平台的servlet建立微信企业号问题总结
- Swift语法基础:1 - Swift的简单介绍
- 运气巧合与吹牛