如何获得短信草案的地址 [英] How to get the Address of a Draft SMS
问题描述
亚姆没有能够得到短信草案,它总是给我的地址空
IAM使用下面的code
iam not able to get the address of the draft SMS, it always giving me null
iam using the following code
public static final Uri SMS_PROVIDER = Uri.parse("content://sms");
Cursor oCursorSMS = mContext.getContentResolver().query(SMS_PROVIDER, null,null,null, null);
oCursorSMS.moveToFirst();
final String[] columns = oCursorSMS.getColumnNames();
for (int i = 0; i < columns.length; i++) {
String ss = cursor.getString(i);
}
在IAM读草案短信地址列返回空
我寻觅了很多,也有很多关于这个问题,但没有一个人的问题都回答。谁能帮我这个
when iam reading a Draft SMS the Address Column returns null
i have searched alot, there are alot of questions about this issue but no one have answer. can anyone help me with this
推荐答案
从URI 内容://彩信,短信/通话简单= TRUE
您可以访问螺纹表,在表中的线程有一列 recipient_ids
,你可以用它来获取地址,请参阅我的答案<一个href=\"http://stackoverflow.com/questions/12492602/fetch-address-from-canonical-addresses-table/12493252#12493252\">here要知道该怎么做。基本上,你想从你的手机短信获得的thread_id
,然后用它做的螺纹表一看,即过滤器应 _id = thread_id_from_sms
。现在得到的recipient_ids,并用它来查找从内容地址://彩信,短信/规范,地址
From the uri content://mms-sms/conversations?simple=true
you can access the threads table, in the threads table there is a column recipient_ids
which you can use to get the address, see my answer here to know how to do that. Basically, you want to get the thread_id
from your sms and then use it to do a look on the threads table, i.e the filter should be _id = thread_id_from_sms
. Now get the recipient_ids and use it to look up the address from content://mms-sms/canonical-addresses
这篇关于如何获得短信草案的地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!