I have an app with two activities -> activity1 and activity2. I want the user to be able to type text into an EditText in activity2, then on the click of a button in activity2 set the value of a button in activity1 to that text and then return to activity1.
What is the best approach to doing this?
Start Activity2 for result. Set result from Activity2. And then in Activity’s onCreate check the value, and set it.
http://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)
There’s a tutorial here.
http://developer.android.com/reference/android/app/Activity.html
Search for “Starting Activities and Getting Results”