Retain state of main activity