Resolved occasional onPause() null pointer exception.