Android创建桌面图标
来源:互联网 发布:网络电视剧排行榜2016 编辑:程序博客网 时间:2024/05/01 09:49
Intent intent = new Intent();
// 广播的频段
intent.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
// 告诉Launcher我们的图标 名称 作用
// 长啥样
// 原图有些大 缩放一下
Options opsts = new Options();
opsts.inSampleSize = 4;
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
R.drawable.girl, opsts);
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, bitmap);
// 叫啥名
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "图标名称");
// 干啥事
Intent homepage = new Intent();
homepage.setAction("包名");
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, homepage);
// 告诉系统Launcher应用不去重复创建
intent.putExtra("duplicate", false);
// 发广播
sendBroadcast(intent);
// 广播的频段
intent.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
// 告诉Launcher我们的图标 名称 作用
// 长啥样
// 原图有些大 缩放一下
Options opsts = new Options();
opsts.inSampleSize = 4;
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
R.drawable.girl, opsts);
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, bitmap);
// 叫啥名
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "图标名称");
// 干啥事
Intent homepage = new Intent();
homepage.setAction("包名");
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, homepage);
// 告诉系统Launcher应用不去重复创建
intent.putExtra("duplicate", false);
// 发广播
sendBroadcast(intent);
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桌面图标变大
- js页面跳转
- vue,router-link传参以及参数的使用
- Java回调机制(二)
- python基础之模块之序列化
- logback log4j log4j2 性能实测
- Android创建桌面图标
- Linux入门5(手记)——挂载
- python opencv3 —— 改变颜色空间(color space)
- C# Dictionary 字典基础知识
- FOUC
- Express 4.x, socket.io, formidable文件的上传(进度条)、下载
- Discuz!开发之后台表格table自动生成函数介绍
- python基础之文件操作
- 面对SDN,我们该怎么办?