0

I have two activities

Class MainActivity{
     //has a single button and
    //invokes SubActivity
}


Class SubActivity{
   //This activity several textfields
}

While SubActivity is alive, I press back button and go back to MainActivity. When I go back to MainActivity again, I would like to get the textfield values from the MainActivity. I tried using context but it doesn't seem to work. Any suggestion is welcome.

JVTura
  • 313
  • 1
  • 4
  • 12
  • http://stackoverflow.com/questions/1124548/how-to-pass-the-values-from-one-activity-to-previous-activity – Toast Feb 18 '15 at 21:01

1 Answers1

0

You either have to pass them in a bundle with the intent to start the activity, write them to shared preferences, or put them in sqlite database. It's not possible to simply read data from another activity.

scubasteve623
  • 637
  • 4
  • 7
  • I do write them with shared preferences but I can't read them back from the MainActivity after the SubActivity closes. – JVTura Feb 18 '15 at 21:18