gpt4 book ai didi

android - 有什么方法可以使用Flutter从设备上卸载应用程序吗?

转载 作者:行者123 更新时间:2023-12-03 03:53:42 31 4
gpt4 key购买 nike

我正在使用device_apps列出设备上的可用应用程序。我想通过点击“图标”按钮来卸载应用程序,有什么办法可以做同样的事情? enter image description here

最佳答案

this question@Vicky Salunkhe启发的答案
要卸载应用,请向其传递软件包名称。 $packageName是变量ex,some.app.id

android_intent.Intent()
..setAction(android_action.Action.ACTION_DELETE)
..setData(Uri.parse("package:$packageName"))
..startActivityForResult().then((data) {
print(data);
}, onError: (e) {
print(e);
});
pubspec.yaml文件中添加一个包
intent: ^1.3.4
manifest中的权限
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
阅读更多答案 here,也可以引用 here

关于android - 有什么方法可以使用Flutter从设备上卸载应用程序吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62146049/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com