到达时删除单条短信
我需要在收到一条短信时从收件箱中删除它。
基本上我的应用程序会知道何时收到短信,它将根据消息处理一些事情,然后需要从收件箱中删除该消息。
我搜索了很多,但只找到了删除整个收件箱的方法;我只需要从收件箱中删除一条消息。
我们将不胜感激您的帮助。
I need to delete a single SMS from the inbox on its arrival.
Basically my application will get to know when an SMS is received, it will process few things depending on the message and then it needs to delete that message from inbox.
I searched a lot, but only found a way to delete entire inbox; I just need to delete a single message from the inbox.
Your help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该使用 abortBroadCast()。意味着在 SMS BroadCastReceiver 中,您将获得发件人联系方式,并将进行比较或执行另一个过程,然后您将在此放置此指令
,因此该消息将被忽略并转到收件箱
you should use abortBroadCast(). means that in the SMS BroadCastReceiver you will get the sender contact and will compare or do another process and there you will put this instruciton
and hence this messages will be ignore to go to inbox
完成后您可以使用 abortBroadcast()。
You can use abortBroadcast() when done.