fix #938: check hasActivity in onPostExecute to avoid a npe

fix #938: check hasActivity in onPostExecute to avoid a npe