That wouldn't work.

App widgets are stateless by design.

The way to implement what you want (from what I can tell) is to broadcast an intent when the user clicks on the widget and handle it in the AppWidgetProvider.

To make the widget broadcast an intent when clicked, use PendingIntent with a custom (defined within your app) action string, and attach it to the view with RemoteViews.setOnClickPendingIntent.

I have a post about this here:

http://kmansoft.wordpress.com/2010/04/10/processing-widget-events-with-pendingintents/

-- Kostya

12.05.2010 20:19, repole пишет:
Thanks for the quick response

I figured the widget could store a variable that's altered on
OnEnabled(), OnDisabled(), etc, and then the app could retrieve that
variable from the widget...or would that note work?

On May 12, 12:15 pm, Justin Anderson<janderson....@gmail.com>  wrote:
I do not believe it is possible to determine if a widget is visible, or even
if it is used...

----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------



On Wed, May 12, 2010 at 10:11 AM, repole<n.rep...@gmail.com>  wrote:
Hey all,
Very new to Android development and trying to get started on a
project. I am curious if it is possible for a separate application to
directly check to see if another widget is open/visible etc., and for
that separate application to send information to the widget? Apologies
is this should be obvious, I've tried searching for examples and not
really come up with anything definitive.
Thanks,
Repole
--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android
To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com>
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow 
athttp://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group 
athttp://groups.google.com/group/android-beginners?hl=en


--
Kostya Vasilyev -- WiFi Manager + pretty widget -- 
http://kmansoft.wordpress.com/sw

--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to