Saturday, April 7, 2012

[android-developers] Re: Global variable extend application class

In fact, I am now setting three member variables in onActivityResult() (a boolean, a String, and a HashMap), and i am trying to access these member variables in the onClick() method of a button's onClickListener. When i access the string and boolean variables their values are set appropriately. However when i access the HashMap variable its value is set to '{}', an empty HashMap. Is there some kind of Serialization that needs to happen with a complex data type?

On Saturday, April 7, 2012 7:13:09 PM UTC-7, Etienne wrote:

So I am trying extend the base android.app.Application class and add member variables to create global variables like in this first solution of the link below.

Android global variable

This works if the member variable is a simple data type like a String. But how would you do it for a more complex data type? In my case i would like the member variable to be of type HashMap.

I am setting the member variable in onActivityResult(), and i am trying to access this member variable in the onClick() method of a button's onClickListener. When i access the String variable it's value is set appropriately. However when i access the HashMap variable its value is set to '{}', an empty HashMap.

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate