2014-05-07 88 views

回答

1
public boolean isAppInstalled(String appName){ 
     PackageManager pkgMan = getPackageManager(); 
     List<PackageInfo> pkgList= pkgMan.getInstalledPackages(0); 
     for(int a=0;a<pkgList.size();a++){ 
      if(appName.equals(pkgMan.getApplicationLabel(pkgList.get(a).applicationInfo))){ 
       return true; 
      }//if app name match needed name 
     }//for loop 
     return false; 
    } 
相關問題