Kacee Saxena wrote:Even i had a similar query about "Passing data between different activities/screens". Currently in my application I am using the Java approach of "Has A" relationship. i.e. by providing getter methods in the Activity class and then other activities can instantiate the class object and call on getter method to access the data field.
Atleast this way, we dont need to worry about "passing data" . The fields can be accessed as an d when needed via its class object.
Any other better ways of doing this ... any suggestion are most welcome
I have declared instance variables as static.
Declaring variables as static seems the easiest way, I wonder how it affects memory and performance.
I've heard of another way but never implemented it. Your Application object is accessible from whatever point in your app. So you extend Application class and add variables that you think should be visible in a 'global' way. Then you will have to do some changing to your manifest and some other stuff
If someone tries this please report back