Android在发件箱中删除短信短信、发件箱、Android

由网友(清丝袅袅)分享简介:Android的奇巧之前,有可能没有他们存储在设备上安装的即时通讯应用的发件箱发送短信,使用此方法:Before Android KitKat, it was possible to send SMS messages without them being stored in the sent folder of...

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)的写访问限制可能的解决方法可以在答案。

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

阅读全文

相关推荐

最新文章