rogcg
rogcg

Reputation: 10471

Am I forced to use the Android notifyChange() method?

Am I forced to use the notifyChange() method? I ask this because, when I call this method it enters on the onChange() method, but when I don't call the notifyChange() the onChange() method is not called. Why?

Upvotes: 1

Views: 1509

Answers (1)

Terrance
Terrance

Reputation: 11872

Okay here goes,

I don't know if this is a complete answer to your question but anything that inherits from the abstract class ContentObserver should call its "onChange" on instantiation. With that in mind take a look at the ContentObserver you are passing to your notifyChange. To start with I'd say debug step by step with that much in mind and tell me what you get...

But based on the source code, It looks as though ContentObserver fires the OnChange and that "bubbles up" through the the notifyChange method.

So with that the best sense I can make of it is that since the point of the ContentObserver is to "Observe" or listen for the firing of events (aka intents i think; I'm still trying to get the android lingo) then if you want your Observer to know your onChange is happening then yeah. But I think I would need more information about how your going about using it to give you a clearer explanation.

And by all means someone please set me straight if I'm at all wrong here in what I said lol.

Upvotes: 3

Related Questions