Yes, sharing data by using plain 'static' or 'global' classes and members 
is possible. 
Be careful what you keep referenced in these static or global 
classes/members: don't hold on to activities and such, keeping them 
alive/references beyond the end of their lifecycle (e.g. after an 
activity's onDestroy).

But Intents, and the data in them in the form of Bundles (Extras), allows 
for inter-process, inter-app, communication. 
Also, Android can restore the Intents and the data in them when a component 
(such as an activity) is restored after it had to be killed earlier (e.g. 
in low memory situations). That's much harder to do with just plain 
'static'/'global' classes and members.


On Wednesday, April 25, 2012 8:46:24 PM UTC-4, Tina Seaburn wrote:
>
> I'm a Windows Phone 7 developer and I use C# as a language.  In your 
> tutorial examples there are Activities (looks like activities have a 
> 1:1 relationship with display pages) and they are communicating with 
> each other by passing "Bundles." 
>
> I'm used to having a Global Static Class where all of the common 
> information exists that is shared by the various activities.  Is this 
> possible in Android Java?  It seems easier than passing bundles. 
>
> Also in WP7 we have "Pivots" and "Panoramas" where a "page" may be 15 
> pages wide and the user can slide them accross.  The same Code Class 
> handles them all so all of the variables are common.  Is there any 
> such vehicle in Android? 
>
> Thanks so much for anyone that can help me with this. 
> Tina

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to