How about using the SharedPreferences mechanism? It is described in the first section of this article:
http://developer.android.com/intl/fr/guide/topics/data/data-storage.html I used it for the very same purpose. It has the added benefit that the value is shared between multiple instances of the app widget, and it is persisted even when the widget is removed from the home screen (although you could choose to reset it if desired). On Fri, Jan 8, 2010 at 11:53 AM, medpur <[email protected]> wrote: > Hi, > > I need to share the value between the activity and app widget , > > Is there any way to achieve this other than using the intents. > > Ex: say x is the variable defined in one class .i need to use the same > variable in the other class .how to achieve this. > > I declared like > > abc.java > Public static int x; > > The above is working only when it is assigned at the time of > declaration. > > like Publoc static int x=3. > i can access this in other class as abc.x > > But it is not allowing to mofify in the abc.java file . > > Please let me know ,is there any other solution , > > > Regards > Rajgopal > > > -- > 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 > [email protected] > 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 at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en

