判断android应用程序是否已安装

android应用程序是否已安装,查看是否此包的相关信息
  PackageInfo packageInfo;

         try {
             packageInfo = this.getPackageManager().getPackageInfo(
                     packagename, 0);

         } catch (NameNotFoundException e) {
             packageInfo = null;
             e.printStackTrace();
         }
         if(packageInfo ==null){
             System.out.println("not installed");
         }else{
             System.out.println("is installed");
         }

你可能感兴趣的:(判断android应用程序是否已安装)