Question

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.

Was it helpful?

Solution

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
  }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top