显示收到的特殊短信的数量

时间:2018-08-12 09:48:12

标签: android sms

每当我有一个未接来电时,我都会收到一条包含姓名和电话号码的新消息。
我正在尝试在自定义列表视图中显示这些消息,但是有一个问题,也许有人给我打了3次,所以我收到3条消息,但是我想显示一条消息,消息中包含相同的消息数(名称和电话号码相同)。如何显示相同的短信数? 我正在使用光标阅读每封邮件。

Uri inboxURI = Uri.parse( "content://sms/inbox" );
String[] reqCols = new String[]{"_id", "address", "body", "date"};
ContentResolver contentResolver = getContentResolver();
Cursor cursor = contentResolver.query( inboxURI, reqCols, null, null, null );

0 个答案:

没有答案
相关问题