📌  相关文章
📜  android 检查是否安装了包 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:49:49.529000             🧑  作者: Mango

代码示例1
import android.content.pm.PackageManager;

 public boolean isPackageExisted(String targetPackage){
   PackageManager pm=getPackageManager();
   try {
     PackageInfo info=pm.getPackageInfo(targetPackage,PackageManager.GET_META_DATA);
   } catch (PackageManager.NameNotFoundException e) {
     return false;
   }  
   return true;
 }