Register ContentObserver for AppWidgetProvider

by Manjunatha M » Tue, 08 Sep 2009 15:55:57 GMT

Sponsored Links

I am writing an application on the widget framework provided by Android.

I want to listen to contacts DB through the contentObserver and update
accordingly on the db change.

I want to register the contentobserver on the chip is enabled and unregister
on the chip disable.

Now that, i can override onEnabled and onDisabled and implement the methods
to register and unregister the contentobservers.

However, I am able to register  the observer in the onEnabled function.

But in the onDisabled, I am seeing the observer as null.

Does any body know or anybody has docs pertaining to this, please share..

Thanks in advance,


Other Threads

1. Checking user activity / whether the screen is locked.


For one reason or another, my last post didn't show up in the
Discussions-list, so here's a repost (sorry):

I'm writing a presence agent application for Android (that checks if
you are 'available' or 'away'). For this I would like to check any
activity on the phone.
The easiest way to do this would be to check whether the screen is
locked. Is there any way to do this?
Alternatively, is there a way to check if the user is 'using' the
screen or touching any keys without having to be in the activity of
this app (so I can check this from within my service when the user is
using other apps).

Thanks in advance!

2. service dead cause ap gotten killed by system?

Hi all,

I have a quick experiment about service and app.
Ap who bound the service will be killed by system if the service dies.

Here is my experiment steps:
1. start camera and taking a picture
2. kill the within adb shell.
3. the camera will killed by system with following logcat.

I/ActivityManager(   60): Process (pid 1968) has died.
I/ActivityThread( 1942): Removing dead content provider: media
I/ActivityThread( 1962): Removing dead content provider: media
I/ActivityManager(   60): Killing app (pid 1942) because
provider is in dying process
I/Process (   60): Sending signal. PID: 1942 SIG: 9
I/ActivityManager(   60): Killing app (pid 1962) because
provider is in dying process
I/Process (   60): Sending signal. PID: 1962 SIG: 9
D/Zygote  (   33): Process 1968 terminated by signal (15)

Following is my questions.
1. is camera killed by ibinder?
2. is there any way to handle the service died in java ap? because in low
memory condition, the service is easy to be killed. Since service will
restart later, maybe AP can just wait for these services restart instead of
killing by system. It seems easy to handle it in native with ibinder's
deadnotifier, but the whole story seems different in java layer.



3. Problem with global variables

4. Install .odex + .apk

5. java.lang.VerifyError -- in Android

6. USB Host Mode: How to change permissions/ownership of newly created devices

7. Bug while selecting from a list of multi-select items whilst using filterable