通过android中的点击侦听器以编程方式删除主屏幕上的小部件

发布于 2024-09-29 14:39:00 字数 116 浏览 0 评论 0原文

我有一个小部件,如果用户通过单击某个按钮等发出命令,我想以编程方式删除它。但据我所知,应用程序和小部件程序将在不同的进程中运行。那么如何才能获得另一个进程远程视图的控制权并删除相同的清除与小部件相关的所有数据库内容呢?

I've a widget which I would like to delete programmatically if the user gives the command by clicking on some button or so. But as per my knowledge the app programme and the widget programme will be running in different processes. So how is it possible to get the control of another process remote view and delete the same clearing all the db contents related to the widget?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

娇纵 2024-10-06 14:39:00

如果您同时开发应用程序和小部件,那么您可以向应用程序发送意图,并在收到意图时删除小部件。

If you are developing both app and widget then you can send intent to the app and remove widget when intent is received.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文