摘要: RT,贴代码: 1 public boolean isPackageExist(pkgName){ 2 boolean isExist = false; 3 final PackageManager packageManager = this.getPackageManager(); 4 List pinfo = packageManager.getInstalledPackages(0); 5 List pName = new ArrayList(); 6 if (pinfo != null) { 7 ... 阅读全文
posted @ 2014-01-23 16:58 wesley.du 阅读(779) 评论(0) 推荐(0) 编辑
摘要: RT,贴代码: 1 public void startAppSafe(String pkgName){ 2 PackageManager pm = getPackageManager(); 3 Intent in = new Intent(Intent.ACTION_MAIN); 4 in.addCategory(Intent.CATEGORY_LAUNCHER); 5 in.setPackage(pkgName); 6 List ri = pm.queryIntentActivities(in, 0); 7 ... 阅读全文
posted @ 2014-01-23 16:50 wesley.du 阅读(2114) 评论(0) 推荐(0) 编辑
摘要: RT,直接贴代码 1 /** 2 * get the status_bar_height 3 * @param activity 4 * @return 5 */ 6 public static int getStatusHeight(Activity activity) { 7 int statusHeight = 0; 8 Class localClass = null; 9 try {10 localClass = Class.forName("com.andr... 阅读全文
posted @ 2014-01-23 16:48 wesley.du 阅读(442) 评论(0) 推荐(0) 编辑