I am facing problem with toggle button state on onResume() and onPause() state.
Activity - A (first user toggle ON the button) then go back to Activity - B, then it will comeback to Activity - A then I want toggle Button is ON not OFF, how to handle this state in android.
By default
Activityhandles its components state which has anidattribute.If it's not acting like that, you can use
onSaveInstanceStateandonRestoreInstanceStateto handle components state manually:And to restore the state: