Android开发获取开机启动项列表
来源:互联网 发布:大学生网络责任感 编辑:程序博客网 时间:2024/04/26 21:49
come from : http://android.tgbus.com/Android/tutorial/201108/363502.shtml
代码如下:
public class BootStartUtils {
private static final String BOOT_START_PERMISSION =
"android.permission.RECEIVE_BOOT_COMPLETED";
private Context mContext;
public BootStartUtils(Context context) {
mContext = context;
}
/**
* 获取Android开机启动列表
*/
public List<Map<String, Object>> fetchInstalledApps() {
PackageManager pm = mContext.getPackageManager();
List<ApplicationInfo> appInfo = pm.getInstalledApplications(0);
Iterator<ApplicationInfo> appInfoIterator = appInfo.iterator();
List<Map<String, Object>> appList = new ArrayList<Map<String, Object>>(appInfo.size());
while (appInfoIterator.hasNext()) {
ApplicationInfo app = appInfoIterator.next();
int flag = pm.checkPermission(
BOOT_START_PERMISSION, app.packageName);
if (flag == PackageManager.PERMISSION_GRANTED) {
Map<String, Object> appMap = new HashMap<String, Object>();
String label = pm.getApplicationLabel(app).toString();
Drawable icon = pm.getApplicationIcon(app);
String desc = app.packageName;
appMap.put("label", label);
appMap.put("icon", icon);
appMap.put("desc", desc);
appList.add(appMap);
}
}
return appList;
}
- Android开发获取开机启动项列表
- Android开发获取开机启动项列表
- 获取Android开机启动项列表
- Android开发_Android如何获取开机启动项列表_查找package是否有开机启动权限
- Android开发_Android如何获取开机启动项列表_查找package是否有开机启动权限
- Android获取开机启动程序列表
- Android 获取Launcher 启动列表
- Android获取开机启动总时间
- android开发-获取wifi列表
- android开发-获取wifi列表
- Android开发:系统自动实现开机启动
- Android 开发 — 开机自启动
- Android手机开发:开机自动启动程序
- Android开发:系统自动实现开机启动
- Android开发:系统自动实现开机启动
- Android开机自启动应用开发
- Android开发 设置开机自动启动
- android软件开发:程序的开机启动
- 为什么.net中引用dll文件属性窗口中的“复制到本地”属性不可用(Why is the Copy Local property for my reference disabled?)
- 网络连接故障处理六部曲
- 我们之所以觉得自己不快乐,是因为我们追求的不是幸福,而是比别人幸福。
- mysql处理百万级以上的数据时如何提高其查询速度的方法
- 纪念红军慈悲阿娇大幅度年
- Android开发获取开机启动项列表
- python数据结构与算法 26 动态规划
- 黑马程序员—Java API(System类、Runtime类、Math类、Date类)
- Oracle group by 分组,并统计
- 安全知识:“云计算”的基本原理和概念
- foj 1880 DP
- 最快的颜色缩减函数
- iOS: Layer Style Property Animations
- String,StringBuffer与StringBuilder的区别??