I'm pretty new, but this is what I do.
In Activity A, you could send an "exrta" to B before starting it.
Example:
in A:
Intent intent = new Intent(this, B.class);
intent.putExtra("myString", "stringValue");
startActivity(intent);
in B (in onCreate):
//get intent and extras
Intent intent = getIntent();
Bundle extras = intent.getExtras();
if(extras != null)
{
//set a member to the value of the extra
mMyString = extras.getString("myString");
}
You could pass it to C in the same manner I guess. Any better
solutions out there?
On Oct 22, 9:54 am, Vinu Vijayan <[email protected]> wrote:
> Hi everyone.....
>
> I'm having an requirement like this.
> Say there are 3 activities A,B &C. From A i'm calling B using
> startactivity() and from B i'm calling C using startactivity(). In A
> there is an edittext field in which i have inserted some chars before
> going to B. Suppose i'm now in C and i want to go to A, how can i
> retain the data which i have already inserted in edittext in A.
>
> If i use startactivity to go to A, then it will start a new activity
> with no data.
>
> Is there any other way to go to an existing activity without using
> startactivity() and i want to retain the data on the previous
> activity??
>
> It would be also helpful if someone could explain me what happens to
> the data entered in the edittext if i goes to another activity??..
>
> Thanks in advance........
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---