Back to project page android_smsoverxmpp.
The source code is released under:
GNU General Public License
If you think the Android project android_smsoverxmpp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.smorra.smsoverxmpp; //w w w . ja v a 2 s . c o m import android.content.ContentValues; import android.content.Context; import android.database.ContentObserver; import android.net.Uri; import android.os.Handler; public class SmsReceiver extends ContentObserver { Context context; public SmsReceiver(Handler handler, Context context) { super(handler); this.context = context; } @Override public void onChange(boolean arg) { System.out.println("ONCHANGE"); try { if (Service_.onSmsReceived()) { ContentValues values = new ContentValues(); values.put("read", 1); context.getContentResolver().update(Uri.parse("content://sms/inbox"), values, null, null); } } catch (Exception e) { e.printStackTrace(); } } }