OK, first off, bear with me as I am relatively new to Android Development.
So here is the situation. I have a parent (main) activity that records data. Lets say, for simplicity sake that it contains an edit box. Now the child (sub) activity contains a single text view that is currently blank. By default, when the app starts the main activity is started. Now when the user enters his name in the edit box and clicks a button I want that name to be appended to the text view on the second activity. I can then switch to the second activity and see that change. I then hit the back button and enter another name. When i switch to the second activity again i must see that change and so on. Obviously, the scenario does not only involve edit boxes and buttons but I think the idea is the same.
So in essence what I want to know is:
- How do i switch between activities and keep the data on each. I would have to create both activities at run time?
- How do I pass data between these activities?
- When i press the back button when the second activity is on focus how do i stop that activity from completely closing?
Thanks for all your help!