添加应用桌面快捷方式的方法
来源:互联网 发布:centos 内核降级 编辑:程序博客网 时间:2024/05/16 06:38
实现效果:长按实现添加桌面快捷方式
代码:
public class OnShortcutListener implements OnItemLongClickListener {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view,
int position, long id) {
// TODO Auto-generated method stub
Intent intentAddShortcut = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");
intentAddShortcut.putExtra(Intent.EXTRA_SHORTCUT_NAME, “name”);
Parcelable icon;
intentAddShortcut.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, R.drawable.ic_launcher);
Intent intentLauncher = new Intent();
intentLauncher.setClass(getBaseContext(), AppViewerActivity.class);
//以下代码实现在桌面点击快捷方式,进入网页的效果
SubApp subapp=subApps.get(position);
Uri uri;
if (subapp.isRemote() == false)
uri=Uri.parse("file:///" + subapp.getAppFolderName()
+ File.separator + subapp.getName());
else
uri=Uri.parse(subapp.getName());
intentLauncher.setData(uri);
intentAddShortcut.putExtra(Intent.EXTRA_SHORTCUT_INTENT, intentLauncher);
sendBroadcast(intentAddShortcut);
return true;
}
}
正在研究如何通过图片路径或Bitmap方式获得快捷方式的图标。
- 添加应用桌面快捷方式的方法
- ubuntu在桌面添加应用的快捷方式
- android应用添加桌面快捷方式
- WinCE桌面添加应用程序的快捷方式
- WinCE桌面添加应用程序的快捷方式
- WinCE桌面添加应用程序的快捷方式
- JS 添加网页桌面快捷方式的代码
- WinCE桌面添加应用程序的快捷方式
- WinCE桌面添加应用程序的快捷方式
- JS 添加网页桌面快捷方式的代码
- 添加桌面快捷方式
- android桌面添加快捷方式
- Android添加桌面快捷方式
- App添加桌面快捷方式
- andorid添加桌面快捷方式
- ubuntu桌面添加快捷方式
- android 添加桌面快捷方式
- [安卓] 如何判断桌面已经添加APP应用的快捷方式
- VC++图片控件(Picture Control)显示资源位图(BMP)、文件位图(BMP)、其它格式文件图片(JPG\PNG\BMP)的方法
- Lucene基础篇2 Directory
- 查看linux服务器配置和TOP命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况。
- MySQL中key问题详解
- 如何在真机上调试Android应用程序(图文详解)
- 添加应用桌面快捷方式的方法
- 通向架构师的道路(第一天)之Apache整合Tomcat
- C++简单笔试题8道
- 啦啦啦
- SAP 菜单增强
- Eclipse开发Android程序如何在手机上运行
- java增删创建文件夹
- 基础算法系列(十四)排序算法之图书馆排序
- 通向架构师的道路(第一天)之Apache整合Tomcat