Is it possible to reset a activity to its normal state when a user clicks the back button from the previous page.
Use Case: On my main activity I have checkboxes and the user goes to the next activity using intent. That activity has a “Back to Main Page” button, but when the user just clicks the back button on the phone the checkboxes are already checked from the last time the user was on the page.
If you want to reset only when returning from that activity then use
startActivityForResult()and overrideonActivityResult.If you want to reset everytime then reset in
onResume()