AppWidgetProvider instances

Put your problem here if it does not fit any of the other categories.

AppWidgetProvider instances

Postby Kh3ldar » Sat Jun 05, 2010 1:21 am

I have an AppWidgetProvider that sets itself up for callbacks in its onEnabled method.

mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0f, this);

so theoretically in its onDisabled method it should unregister ...

mLocationManager.removeUpdates(Instance);

I assumed this would be OK in the belief that there is one instance of this AppWidgetProvider created, which in turn handles all the individual widgets created at run time. I am finding that this is not the case. "this" in onEnabled does not equal "this" in onDisabled.

I have got round this issue by assigning this to a static in onEnabled and using that to unregister in onDisabled.

I guess I'm missing something really obvious, any thoughts?
Kh3ldar
Freshman
Freshman
 
Posts: 2
Joined: Mon May 31, 2010 2:35 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 22 guests