赛风

2016-11-01  本文已影响0人  水手在沙漠001

赛风

赛反思,赛风
森单

 private void showTip(final String str) {    
              mToast.setText(str);    
              mToast.show();
             }
  private void showTip(final String str) {    
          mToast.setText(str);    
          mToast.show();
         }

sdwfjsjdf

private boolean isAppInstalled(String uri){        
boolean isPackageName = false;       
 PackageManager pm = getPackageManager();       
 PackageInfo packageInfo = pm.getPackageArchiveInfo(uri, PackageManager.GET_ACTIVITIES);       
 Log.e(TAG,"packageInfo = "+packageInfo);       
 if(packageInfo != null) {            ApplicationInfo appInfo = packageInfo.applicationInfo;            // 得到包名//                                String appName = pm.getApplicationLabel(appInfo).toString();//app名称            String packageName = appInfo.packageName; //包名            Log.i(TAG, "包名:" + packageName);            for (int j = 0; j < appList.size(); j++) {                if (appList.get(j).packageName.equals(packageName)) {                    isPackageName = true;                    //退出当前for循环                    j = appList.size();                }            }        }        return isPackageName;    }
上一篇下一篇

猜你喜欢

热点阅读