检测新彩信 (Android 2.1)
我想识别新彩信的到达(在下载到收件箱后)。我正在执行以下操作:
private MMSContentObserver mMmsCO;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
h = new Handler();
mMmsCO = new MMSContentObserver(h);
getContentResolver().registerContentObserver (Uri.parse("content://mms"), true, mMmsCO);
}
然而
private class MMSContentObserver extends ContentObserver {
public MMSContentObserver(Handler h) {
super(h);
}
@Override
public boolean deliverSelfNotifications() {
return false;
}
@Override
public void onChange(boolean selfChange) {
super.onChange(selfChange);
}
}
, onChange 没有被调用。我缺少什么? 提前致谢。
I'd like to recognize arrival of new MMS msg (after it is downloaded to inbox). I am doing the following:
private MMSContentObserver mMmsCO;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
h = new Handler();
mMmsCO = new MMSContentObserver(h);
getContentResolver().registerContentObserver (Uri.parse("content://mms"), true, mMmsCO);
}
where
private class MMSContentObserver extends ContentObserver {
public MMSContentObserver(Handler h) {
super(h);
}
@Override
public boolean deliverSelfNotifications() {
return false;
}
@Override
public void onChange(boolean selfChange) {
super.onChange(selfChange);
}
}
However, onChange is not getting called. What am I missing?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MMS 内容提供程序不是 SDK 的一部分,但可以使用...这里的真正答案会很好,因为所有消息应用程序都以某种方式或形式使用 content://mms。
由于谷歌决定不标准化彩信,我们都必须在每部手机上进行测试,但我们仍然需要能够在我们的应用程序中处理彩信。
The MMS content provider isn't part of the SDK but it can be used... a real answer here would be nice since all messaging apps use content://mms in some way or shape.
Since google decided not to standardize MMS we are all have to test on every phone out there but we still need to be able to handle MMSs in our apps.