Boreded Boreded - 1 year ago 95
Android Question

Android activity finish update previous activity

I have an activity where you can click on a product and it adds it to a basket, a button is then pressed to checkout where a new activity is started, this activity lists everything in the basket with an option to remove the item. If ALL items are removed I am calling finish() on this activity to go back to the previous activity that listed all the products.

The problem is that this previous activity still says X items have been selected, how can I get this to update or to reload?

Many Thanks.

Answer Source

You should put your refresh code inside the onResume method of your Activity.

Take a look at the Activity Lifecycle here for more information:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download