3

我对 Android 开发非常陌生。我需要你的一些澄清。我的问题是“是否可以以编程方式将短信数量存储在起草者中?”。请帮助我。

谢谢你,Sekhar Bethalam。

4

2 回答 2

7

是的,您可以将消息保存为草稿,执行此操作的代码如下:

//Store the message in the draft folder so that it shows in Messaging apps.
ContentValues values = new ContentValues();
// Message address.
values.put("address", address); 
// Message body.
values.put("body", messagebody);
// Date of the draft message.
values.put("date", String.valueOf(System.currentTimeMillis())); 
values.put("type", "3");
// Put the actual thread id here. 0 if there is no thread yet.
values.put("thread_id", "0"); 
getContentResolver().insert(Uri.parse("content://sms/draft"), values);

快乐编码!

于 2011-07-28T14:41:39.710 回答
1

你的意思是你正在制作一个短信应用程序并且你想保存消息草稿?那是100%你的问题。您可以随意保存草稿。除了传递包含文本的意图并为您发送文本之外,几乎没有 Android 对发短信的帮助。

于 2011-01-04T18:00:06.223 回答