Android在发件箱中删除短信

编程入门 行业动态 更新时间:2024-10-22 03:07:00
本文介绍了Android在发件箱中删除短信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Android的奇巧之前,有可能没有他们存储在设备上安装的即时通讯应用的发件箱发送短信,使用此方法:

Before Android KitKat, it was possible to send SMS messages without them being stored in the sent folder of the installed messaging apps on the device, using this method:

SmsManager sms = SmsManager.getDefault(); sms.sendTextMessage(phonenumber, null, message, null, null);

但它是如何做后期奇巧?你有没有删除由您的应用程序发送的短信?如果是这样,它是如何做正确?

But how is it done post-KitKat? Do you have to delete the messages that are sent out by your app? And if so, how is it done correctly?

推荐答案

与奇巧,用 SEND_SMS 权限的任何应用程序启动能够与标准的发送邮件 SmsManager 方法,系统会自动处理写消息的提供者。作为默认的应用程序是使用对供应商进行写访问的只有一个,那就是可以删除信息只有一个,所以任何非默认的应用程序将无法删除自动写入这些邮件。 * 如果你不希望他们被写做,你的应用程序应该被设置为默认的短信应用。默认的应用程序是负责撰写自己的传出消息,它可以选择不这么做。

Starting with KitKat, any app with the SEND_SMS permission is able to send messages with the standard SmsManager methods, and the system will handle writing the messages to the Provider automatically. As the default app is the only one with write access to the Provider, it is the only one that can delete messages, so any non-default app won't be able to delete those messages written automatically.* If you don't want them to be written, your app should be set as the default SMS app. The default app is responsible for writing its own outgoing messages, and it can opt not to do so.

*为的是Android 4.4(KitKat)的写访问限制可能的解决方法可以在 href=\"stackoverflow/a/27709655\">答案。

* A possible workaround for the write access restriction in Android 4.4 (KitKat) can be found in the answer here.

更多推荐

Android在发件箱中删除短信

本文发布于:2023-11-12 12:01:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1581448.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:短信   发件箱   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!