views:

32

answers:

1

The online android documentation says:

Everything you can do with AppWidgetProvider, you can do with a regular BroadcastReceiver.

So, what i want to do is to register via registerReceiver() another event other than ACTION_APPWIDGET_* on my Widget. For example ACTION_BATTERY_OKAY, is there any way to do this? Obviously i cant register the event from the onUpdate() code but i should do it using a service or something else. The problem is that im not able to find any reference to the Provider (AppWidgetManager only returns AppWidgetProviderInfo objects).

Any idea?

A: 

i think you would want to define your ACTION_BATTERY_OKAY intent filter in your AndroidManifest.xml and then override the onReceive and be sure to call super.onReceive to handle the appwidget dispatching.

jason gilbert
I know that i can register the event on the manifest, but i want to do it via Java Code.
JohnUopini

related questions