views:

36

answers:

1

I have a setup view where the user can enter their name and email and click done when they are finished which navigates them to another activity1. When they are in activity1, and they hit the soft back button on the phone, it takes them screen where they entered their name and email. However, the name and email EditText fields are blank.

In the view where the name and email are entered I looked to see if onStart, onCreate, OnPause, onResume,... where being called after the back button was hit, but they are not.

Do you know how I can make it so that the EditText fields have the information that was previously entered.

A: 

Well, you could store the data in a singleton class, and when they go back to the activity, it checks if those values exist and populate the EditText.

Here's how you can override the onresume:

@Override
  public void onResume() {
    super.onResume();

    // do whatever you need to do here
  }
xil3
Do you know what events are fired when the user returns to the previous activity? I tried wiring up eclipse and the debugger to all the events I know about but none were fired when the user returns to the previous activity on the activity stack...
Alexis K
'public void onResume()' gets fired when you return to the activity.You can override it and do what you need - I updated the answer with the code.
xil3