从 Android 设备卸载应用程序包时出现问题
我们有一个应用程序,在启动时会显示“条款和条件”屏幕。当用户拒绝这些条款时,我们必须询问用户是否希望删除该包。
因此,从应用程序内部我们启动以下意图:
Uri uninstallUri = Uri.parse("package:some.package.name");
Intent intent = new Intent(Intent.ACTION_DELETE, uninstallUri);
startActivity(intent);
这将带来“设置”->“管理应用程序 ->我们的应用程序的卸载页面。
用户可以继续卸载该软件包。但是,当他选择不这样做(按“取消”)时,他就会进入我们的条款和条件活动。如果他再次按“返回”,他就会退出应用程序。 问题是,现在如果我们拉启动器菜单,我们的应用程序图标不会显示。我们可以在“最近启动的应用程序列表”中看到它,并且该应用程序仍然存在于设备上。
这是因为 PackageManager 禁用了我们的应用程序吗?如果是这样,我们如何重新启用它?
我们在这里错过了什么?
请帮忙。
谢谢。
We have an application which on start up pulls up a Terms and Conditions screen. When the user declines these terms we have to ask the user if he wishes to delete the package.
So, from within the application we launch the following intent:
Uri uninstallUri = Uri.parse("package:some.package.name");
Intent intent = new Intent(Intent.ACTION_DELETE, uninstallUri);
startActivity(intent);
This brings the Settings-> Manage Applications -> Uninstall page for our application.
The user can go ahead and uninstall the pacakge. But when he chooses not to(by pressing Cancel) he is taken to our Terms and Conditions Activity. If he presses Back again, he is taken out of application.
The problem is that now if we pull the launcher menu, our application icon does not show up. We can see it in the "Recently Launched application list" and the application is still there on the device.
Is this because PackageManager disabled our application? If so, how do we re-enable it?
What did we miss here?
Please help.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论