0
我正在開發一個android應用程序,它在收到SMS消息時將其標記爲已讀。我這樣做,使用此代碼:刪除android中的新消息圖標
if(readMessages.contains(id)){
ContentValues values=new ContentValues();
values.put("read", 1);
values.put("seen", 1);
getContentResolver().update(Uri.parse("content://sms/inbox"),
values, "_id="+id, null);
Log.i("read message","id:"+id);
if(readThread.contains(trdid)){
ContentValues values1=new ContentValues();
values1.put("read", 1);
values1.put("seen", 1);
getContentResolver().update(Uri.parse("content://sms/inbox"),
values, "_id="+trdid, null);
Log.i("read thread","id:"+trdid);
}
}
正如你所看到的,我標誌着線程和消息的ID爲READ,並且讀取標實的消息。
但是我的問題是,爲什麼在執行代碼後消息應用程序上的圖標(顯示新消息數的紅色氣泡)消失?有可能這樣做嗎?
謝謝! :)
我使用Android 2.3,消息確實顯示一個紅色的泡泡。無論如何,底線是它不能完成。收到消息! – Anirudh 2013-03-16 08:01:48