Check for valid activity before stopping the refresh animation.