Yes my Activities are all in the same application. I'm not sure about
"Task".

Although I'm not killing my one activity (say activityOne )when
launching another activity ( say activityTwo) but are there any
chances that Android might simply kill my activityOne and I may loose
the data which I'm expecting in  activityTwo by storing it as static ?



On Mar 13, 4:00 pm, Edward  Falk <ed.f...@gmail.com> wrote:
> Are the activities all in the same application?  Same task?  It seems
> to me that you could just store the data in a static variable
> accessible by all of the activities.  Am I missing something?
>
> public class MainActivity extends Activity {
>   ...
>   static MyDataStructure dataStruct = null;
>   ...
>   public void onCreate(Bundle state) {
>     ...
>     dataStruct = ReadData();
>   }
>
> }
>
> ...
>
> public class AnotherActivity extends Activity {
>   ...
>   void SomeMethod() {
>     DoSomethingWithData(MainActivity.dataStruct);
>   }
>
> }
--~--~---------~--~----~------------~-------~--~----~
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-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to