Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 841233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:45:31+00:00 2026-05-15T05:45:31+00:00

I have a content observer that polls content://sms/ in android 1.5 so that I

  • 0

I have a content observer that polls content://sms/ in android 1.5 so that I get notified of changes in the sms database and can react to them accordingly.

However in 1.6 this doesn’t work, has the uri been changed from content://sms/ to something else?

I have seen content://mms-sms/ popping up in the logcat on my 1.6 device but I have tried that and it doesn’t work.

Here is my code

String url = "content://sms/"; 
        Uri uri = Uri.parse(url); 
        getContentResolver().registerContentObserver(uri, true, new MyContentObserver(handler)); 


}

class MyContentObserver extends ContentObserver { 

    public MyContentObserver(Handler handler) { 

        super(handler); 

    }

@Override public boolean deliverSelfNotifications() { 
    return false; 
    }

ContentValues values = new ContentValues();


@Override public void onChange(boolean arg0) { 
    super.onChange(arg0);

     Log.v("SMS", "Notification on SMS observer"); 
     values.put("status", 5);
    Message msg = new Message(); 
    msg.obj = "xxxxxxxxxx";
    int threadId = 0;
    handler.sendMessage(msg);

    Uri uriSMSURI = Uri.parse("content://sms/");
    Cursor cur = getContentResolver().query(uriSMSURI, null, null,
                 null, null);
    cur.moveToNext();
    String protocol = cur.getString(cur.getColumnIndex("protocol"));
    Log.d("SMS", "SMS PROTOCOL = " + protocol); 

    if(protocol == null){
           Log.d("SMS", "SMS SEND"); 
           threadId = cur.getInt(cur.getColumnIndex("thread_id"));
           int status = cur.getInt(cur.getColumnIndex("status"));
           Log.d("SMS", "STATUS = " + status);


           if(status != 5){
           Uri updateUri = ContentUris.withAppendedId(Uri.parse("content://sms/conversations/"), threadId);
           int rows = getContentResolver().update(updateUri, values, null, null);
           Log.d("SMS", "ROWS UPDATED = " + rows);
           Log.d("SMS 2", "STATUS = " + status);
           }


           Log.d("SMS", "SMS SEND ID = " + threadId); 

           String textBody = cur.getString(cur.getColumnIndex("body"));
           String textAddress  = cur.getString(cur.getColumnIndex("address"));
           Log.d("SMS", "SMS SEND ADDRESS= " + textAddress); 
           Log.d("SMS", "SMS SEND BODY= " + textBody); 


    }
    else{
        Log.d("SMS", "SMS RECIEVE");  

    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:45:32+00:00Added an answer on May 15, 2026 at 5:45 am

    Uri.parse("content://mms-sms")

    Please ensure the process is running for monitoring the changes.

    My device is milestone (2.1 update1)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of help links that have content in them that appears
I have a content query web part that queries by content type against a
I have some content that i have to render as a excel file in
I'm starting a Wordpress Blog that will have adult content on it, so I'll
In silverlight 2.0. I have some content that i want to scroll vertically and
I currently register a content observer on the following URI content://sms/ to listen out
I have a whole host of models that watch themselves for changes. When a
I have a blank <a> tag that content is loaded into via an external
I have a content type that references multiple nodes, and I need a way
I have a content management application in the root of my website, and I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.