Questions tagged [contentobserver]

Receives call backs for changes to content. Must be implemented by objects which are added to a ContentObservable.

Receives call backs for changes to content. Must be implemented by objects which are added to a ContentObservable.

It has the following public meathods

Public Methods

boolean deliverSelfNotifications()

Returns true if this observer is interested receiving self-change notifications.

final void dispatchChange(boolean selfChange, Uri uri)

Dispatches a change notification to the observer.

final void dispatchChange(boolean selfChange)

This method was deprecated in API level 16. Use dispatchChange(boolean, Uri) instead.

void onChange(boolean selfChange, Uri uri)

This method is called when a content change occurs.

void onChange(boolean selfChange)

This method is called when a content change occurs.

259 questions
0
votes
0 answers

Android ContentObserver: How to reach only new updated data?

I register SMS ContentObserver in my app. I want to update my ArrayList onChange with MessageID. This is my ObServer code.. public class SmsObserver extends ContentObserver { private Context mContext; private String contactId = "",…
0
votes
1 answer

int value not getting updated in onchange of ContentObserver

i am developing an android app, where my class extends ContentObserver.I am registering my class for observing the changes in VOLUME_RING. the onchange method of my class gets called only upon volume button changes. The problem is, an global int…
Dave
  • 297
  • 3
  • 4
  • 15
0
votes
1 answer

how to create a service detect new Contact Add

I find a lot of code to detect the noveaux add contacts for example public class ContactsObserver extends ContentObserver { private final static String TAG = ContactsObserver.class.getSimpleName(); private Context ctx; private…
user2282259
  • 155
  • 1
  • 3
  • 9
0
votes
1 answer

ContentObserver for Documents

I need to be able to track additions/deletions of Documents to the android file system. By Documents, I mean files like word, excel, powerpoint and pdf, for now. I am aware of ContentProviders and ContentObservers. As far as ContentObserver's are…
Code Poet
  • 11,227
  • 19
  • 64
  • 97
0
votes
1 answer

Finding Caller of ContentResolver.notifyChange

I have an activity for updating a table which holds configuration data for a service. I am using a SimpleCursorLoader and the SupportLoaderManager to update the listview in that Activity. I destroy the loader in In the activity's onDestroy. This…
frenziedherring
  • 2,225
  • 2
  • 15
  • 23
0
votes
0 answers

How to reset unread sms counter variable?

I have content observer which "observes" table changes in "content://sms". My app i'm working on, checks for unread SMS messages and it's working fine. The value of unread messages i'm storing in static variable ( need reference from another class…
rootpanthera
  • 2,731
  • 10
  • 33
  • 65
0
votes
1 answer

Detect that MMS has been deleted

Is there a way to detect that an MMS message has been deleted from the native messaging client? Right now I have an observer registered for Mms.CONTENT_URI but onChange is not being called.
Asahi
  • 13,378
  • 12
  • 67
  • 87
0
votes
1 answer

Android ContentObserver - Contacts - No presence updates

I have been rooting around in the framework on ICS, and it appears that the ContactsProvider2, in the Android Contacts Provider, calls notifyChange after any insert/update, not only that, it does it by: NotifyChange(ContactsContract.AUTHORITY_URI,…
Chrispix
  • 17,941
  • 20
  • 62
  • 70
0
votes
3 answers

ContentObserver on SMS inbox not working

I start a service that registers ContentObserver on the SMS inbox like so smsObserver = new SmsObserver(new Handler()); getContentResolver().registerContentObserver(Uri.parse("content://sms/inbox"), true, smsObserver); Here is the class, I just…
tyczj
  • 71,600
  • 54
  • 194
  • 296
0
votes
1 answer

How to implement a Mule Message Observer?

Im trying to implement a simple message observer on Mule that don't need to mutate the message. This link on the documentation says that the easiest way is to extend the AbstractMessageObserver. But as i can see on this link the class has been…
jonfornari
  • 530
  • 1
  • 4
  • 20
0
votes
1 answer

Android: cursor.close() when using registerContentObserver

Do i have to close a cursor when using startManagingCursor(cursor); //I know its deprecated and cursor.registerContentObserver(.. if so, where to close it?
Oritm
  • 2,113
  • 2
  • 25
  • 40
0
votes
1 answer

How to determine where a contact was added?

I have been struggling with an approach to this problem for some time now. There is no Intent action fired off when a contact is added (as far as I know). What are my options to solve this issue? Here are some ideas I have been playing…
Shane
  • 2,315
  • 3
  • 21
  • 33
0
votes
2 answers

How to check which ContentObserver triggers the onChange method?

What I want to do is to have a Service with more than one ContentObserver registered and check which ContentObserver triggers onChange() to do specific reactions. I dont know if I just have to include a if/else inside the onchange(), or Overwrite it…
0
votes
1 answer

android Activity and a service with sms contentobserver

My app requirements The application will have an activity and a service. The service has a sms contentobserver. After application installation the Service should run all the time irrespective of application active or not The registration and…
user1123931
  • 479
  • 1
  • 8
  • 24
0
votes
2 answers

CalledFromWrongThreadException: Android ContentObserver and Activity interface

I have a ListActivity with a SMS ContentObserver. The ListView displays SMS sent/received. Whenever there is change in the SMS database (sent/received), the observer calls a function within the Activity which updates the ListView. This works ok in…
user1123931
  • 479
  • 1
  • 8
  • 24
1 2 3
17
18