我只想获得我收到的短信,但是我修改URI,改为sent draft inbox,无论怎么改,得到的总是所有短信,请问怎么解决啊?
我的代码如下:
final Uri SMS_INBOX_CONTENT_URI = Uri.parse("content://sms/inbox");
final ContentResolver contentResolver = mContext.getContentResolver();
mCursor = contentResolver.query(SMS_INBOX_CONTENT_URI,
new String[] {"_id,address,person,date,read,status,type,body,count(address) as "
+ "totleCount from (select _id,substr(address,4) as address,person,date,read,status,type,body "
+ "from sms where address like \"+86%\" union select _id,address,person,date,read,status,type,body "
+ "from sms where address not like \"+86%\") r group by r.address order by r.date desc --"},
null, null, null);
我的代码如下:
final Uri SMS_INBOX_CONTENT_URI = Uri.parse("content://sms/inbox");
final ContentResolver contentResolver = mContext.getContentResolver();
mCursor = contentResolver.query(SMS_INBOX_CONTENT_URI,
new String[] {"_id,address,person,date,read,status,type,body,count(address) as "
+ "totleCount from (select _id,substr(address,4) as address,person,date,read,status,type,body "
+ "from sms where address like \"+86%\" union select _id,address,person,date,read,status,type,body "
+ "from sms where address not like \"+86%\") r group by r.address order by r.date desc --"},
null, null, null);
解决方案 »
- Android 桌面widget 有办法接收系统广播吗?
- 急,ListView的notifyDatasetChanged()问题
- 关于Activity Launch mode的奇怪现象
- 界面尺寸及layout问题
- 我想建个查询系统的网站
- 如何让音乐播放10s停10s再播放10s循环下去?
- 安卓环境搭建。
- 请问谁有做过手机定位的,求源码(用baidu不要google)
- 应用在个别手机崩溃,没看懂原因
- 为什么使用handler后还是会报 android.view.ViewRootImpl$CalledFromWrongThreadException: Only
- android 如何获得修改系统时间权限
- android开发中流量监控中和中国移动通信的那个模块是怎么实现的。
from inbox,都不行啊
你的这个sql把like和not like进行了 union,那肯定是全部的数据了。