install / uninstall APKs programmatically (PackageManager vs Intents)

后端 未结 10 2113
时光取名叫无心
时光取名叫无心 2020-11-22 13:53

My application installs other applications, and it needs to keep track of what applications it has installed. Of course, this could be achieved by simply keeping a list of i

10条回答
  •  执念已碎
    2020-11-22 14:28

    If you are passing package name as parameter to any of your user defined function then use the below code :

        Intent intent=new Intent(Intent.ACTION_DELETE);
        intent.setData(Uri.parse("package:"+packageName));
        startActivity(intent);
    

提交回复
热议问题