Fix mainview handling when our activity gets destroyed and resumed