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 5988271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:56:06+00:00 2026-05-22T22:56:06+00:00

I want to watch a system setting and get notified when its value changes.

  • 0

I want to watch a system setting and get notified when its value changes. The Cursor class has a setNotificationUri method which sounded nice, but it doesn’t work and coding it also feels strange… Thats what I did:

    // Create a content resolver and add a listener
    ContentResolver resolver = getContentResolver();
    resolver.addStatusChangeListener(ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS | ContentResolver.SYNC_OBSERVER_TYPE_PENDING | ContentResolver.SYNC_OBSERVER_TYPE_ACTIVE, new MyObserver());

    // I somehow need to get an instance of Cursor to use setNotificationUri in the next step...
    Cursor cursor2 = resolver.query(Settings.System.CONTENT_URI, null, null, null, null);

    // For testing purposes monitor all system settings
    cursor2.setNotificationUri(resolver, Settings.System.CONTENT_URI);

The listener:

public class MyObserver implements SyncStatusObserver {

public void onStatusChanged(int which) {
    Log.d("TEST", "status changed, which = " + which);

}
}

Well, obviously the listener gets never called, I can’t find an entry with the specified TEST tag in logcat ): (For testing I manually changed the brightness setting from manual to automatic in the android settings menu). Any hint what I am doing wrong? Any other, better way to monitor Android system settings?

Thanks for any hint!

  • 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-22T22:56:07+00:00Added an answer on May 22, 2026 at 10:56 pm

    here is how it can be done, works great: How to implement a ContentObserver for call logs. note than some settings are first written / reallly changed when the user presses the back key in the system preference screen where he changed something!

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

Sidebar

Related Questions

I want to start a subprocess and watch it's redirected output. That not a
I have a web application which runs on MySQL, and uses Java, Struts2 and
I am creating a windows service in C# .net. In the service i have
Situation: running a Google App Engine site with my static content's default_expiration set to
OK. The title of this qiestion is not easy to decode, but let me
well i am doing a connection... sql server with web service, web service with
I am writing a simple script on Windows PowerShell in order to evaluate performance
Currently I'm working on a RFID project where each tag is attached to an
I'm using MVC 3 and FormsAuthentication: <authentication mode=Forms> <forms loginUrl=~/Account/ timeout=2880 /> </authentication> My
I've seen a lot of similar questions, but I don't think I'm duplicating. Here's

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.