[android-developers] Know if your widget is on the homescreen

2010-06-24 Thread Albert
Hi there,

Is there a way to know if there is an instance of your widget
currently on the homescreen? I always end up using variables that
change state with onUpdate() and onDeleted()  calls, but that
obviously that isn't effective in every scenario.

Thanks in advance

Alberto

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Know if your widget is on the homescreen

2010-06-24 Thread Mark Murphy
On Thu, Jun 24, 2010 at 1:17 PM, Albert albert8...@googlemail.com wrote:
 Is there a way to know if there is an instance of your widget
 currently on the homescreen?

The AppWidgetProvider is notified on every add and remove operation,
along with first-add and last-remove operations.

Or, you can ask your AppWidgetManager getAppWidgetIds().

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en