![](https://i-blog.csdnimg.cn/blog_migrate/eabf2a1821257c85af8b4ab4a407042d.png)
ContentValues values = new ContentValues();
values.put(Data.RAW_CONTACT_ID, rawContactId);
values.put(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);
values.put(Phone.NUMBER, "1-800-GOOG-411");
values.put(Phone.TYPE, Phone.TYPE_CUSTOM);
values.put(Phone.LABEL, "free directory assistance");
Uri dataUri = getContentResolver().insert(Data.CONTENT_URI, values);
如何实现查询短信功能
如何实现增加短信功能
如何实现修改短信功能
如何实现删除短信功能
private SmsObserver smsObserver;
private ContentResolver contentResolver;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sms);
smsId = findViewById(R.id.sms_id);
smsObserver = new SmsObserver(handler,this);
contentResolver = getContentResolver();
//注册观察者
contentResolver.registerContentObserver(Telephony.Sms.CONTENT_URI,true,smsObserver);