安卓:SMS数据库更新接收器? [英] Android: SMS Database Update Receiver?

查看:136
本文介绍了安卓:SMS数据库更新接收器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我更新在SMS数据库SMS状态。像这样的:

I'm updating sms status in sms database. Like this:

ContentValues StatusValues = new ContentValues();
StatusValues.put("status", 0);
StatusValues.put("type", 2);

ActivityContext.getContentResolver().update(Uri.parse("content://sms"), StatusValues, "_id = " + MessageID, null);

我要学习它的这些变化。我该怎么办?

I want to learn its these changes. What can I do?

推荐答案

您需要创建一个扩展的 ContentObserver 然后通过调用你的ContentProvider注册它的<一个href=\"http://developer.android.com/reference/android/content/ContentResolver.html#registerContentObserver%28android.net.Uri,%20boolean,%20android.database.ContentObserver%29\"相对=nofollow> ContentResolver.registerContentObserver()方法

You need to create a class that extends ContentObserver then register it with your ContentProvider by calling the ContentResolver.registerContentObserver() method.

更多信息可以在Android开发者文档中找到

More information can be found in the Android Developer Documentation

这篇关于安卓:SMS数据库更新接收器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆