That is right, I'm simply trying to see if the widget is being displayed/open from a separate application.
That said, appreciate the help as well Kostya, as my widget will eventually need some simple interaction and when I get to that point what you mentioned will certainly be helpful. On May 12, 1:02 pm, Justin Anderson <janderson....@gmail.com> wrote: > *> That wouldn't work.* > Why not? > *> App widgets are stateless by design.* > > True, but depending on what you are wanting to do, you can store state using > SharedPreferences... > *> 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.* > > Correct, if you ware wanting to do stuff based on clicks on the widget, but > that doesn't seem to be what he wants/needs to do... He just wants to know > if a widget is being displayed/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:51 AM, repole <n.rep...@gmail.com> wrote: > > For anyone else interested/reading this later, googling "key value > > pair in SharedPreferences" led me to > >http://developer.android.com/guide/topics/data/data-storage.html, > > which had a bunch of the information I was looking for. > > > Thanks for being so helpful/quick to respond Justin. > > > On May 12, 12:24 pm, Justin Anderson <janderson....@gmail.com> wrote: > > > That might work... I haven't ever messed with those methods though so I > > > don't know for sure. > > > > When I need to get information from a widget that I have created, I have > > the > > > widget create a key/value pair in SharedPreferences and have my activity > > > retrieve it from there. AFAIK there is no way to do direct communication > > > with a widget. > > > > ---------------------------------------------------------------------- > > > 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:19 AM, repole <n.rep...@gmail.com> wrote: > > > > 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> > > <android-beginners%2bunsubscr...@googlegroups.com<android-beginners%252bunsubscr...@googlegroups.com> > > > > > <android-beginners%2bunsubscr...@googlegroups.com<android-beginners%252bunsubscr...@googlegroups.com> > > <android-beginners%252bunsubscr...@googlegroups.com<android-beginners%25252bunsubscr...@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<android-beginners%2bunsubscr...@googlegroups.com> > > <android-beginners%2bunsubscr...@googlegroups.com<android-beginners%252bunsubscr...@googlegroups.com> > > > > > > For more options, visit this group athttp:// > > > > 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 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> > > <android-beginners%2bunsubscr...@googlegroups.com<android-beginners%252bunsubscr...@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<android-beginners%2bunsubscr...@googlegroups.com> > > > For more options, visit this group athttp:// > > 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 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 -- 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