abhishek
abhishek

Reputation: 1434

back pressed should bring the refreshed activity

Hey guys Activity A fires intent on activity B and then on back pressed of activity B the saved state of Activity A is shown.

I want to show the updated / refreshed state of activity A when back pressed on Activity B

Upvotes: 2

Views: 1377

Answers (3)

Philio
Philio

Reputation: 4185

If you're using multiple different activities you can also use startActivityForResult() and then perform post-result processing by overriding the onActivityResult method. This also gives you the option to perform different tasks based on the result and the activity that the user was just returned from.

Upvotes: 0

Denys Nikolayenko
Denys Nikolayenko

Reputation: 568

You should override onResume() method in your Activity A and update state there.

Upvotes: 3

CommonsWare
CommonsWare

Reputation: 1006614

Then refresh your data in onResume() of activity A.

Upvotes: 8

Related Questions