How to save activity state after pressing back button?
问题 I have 2 activities A and B first one having products list and second one is the shopping cart. On click of a button in the list I am adding products to the cart. Now I go to the cart and delete some items from it. I press back and came to the activity A again. Now if I go to the B(cart) again the list is null i.e there are no products in the cart. I am using onSaveInstanceState and onRestoreInstanceState to save an restore the instance of cart activity but that is not working. Perhaps this