I have an activity that is resumed after a user picks a contact. Now before the user picks a contact onSavedInstanceState is called and i put a string in the Bundle. Now, After the user selects the contact and the results are returned. onRestoreInstanceState doesnt get called. only onResume() gets called. So how would i go about pulling my string back out of the bundle once the activity is resumed?
Share
Lets say you have two Activities A and B, and Activity A starts Activity B. If you want to pass information from A to B, you can pass information from A to B with:
Then in Activity B you can get the string with
However, if you want to pass information from B to A you have to use a different method. Instead of using
startActivityyou need to usestartActivityForResult. A description of this method is found here: How to return a result (startActivityForResult) from a TabHost Activity?