Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要构造 PackageUri 以便使用 action.delete 卸载包。我使用 PackageMananger 获得了 PackageInfo 对象。有没有办法使用 PackageInfo 构造 PackageUri?
谢谢。
我明白了,假设我们有 PackageInfo pinfo
String pkg= "package:"+ pinfo.packageName; Uri pkg_uri= Uri.parse(pkg);
现在我们有包 uri,要卸载
Intent intent = new Intent(Intent.ACTION_DELETE, pkg_uri); startActivity(intent);