Improve Android pause/resume behavior.