Handle restoring properly in case when activity stays alive.