編輯:Android開發實例
代碼如下:
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任務,通過加載進度條的進展。進度條有兩種形狀。加載欄和加載微調(spinner)。在本章中,我們將討論微調(spinner)。Spinner 用
在RSS概述中簡單介紹了RSS,本節將為大家講解RSS文件的解析,而又因為RS
可以顯示在的Android任務,通過加載進度條的進展。進度條有兩種形狀。加載欄和加載微調(spinner)。在本章中,我們將討論微調(spinner)。Spinner 用
因為在framework中想添加這個功能,所以寫了個appliction來實現一下獲取正在運行的應用程序: 還是先看圖吧: 這個app主要是簡單的實現了獲取非系統