完成AsyncTask的后onPostExecute不叫 [英] onPostExecute not called after completion AsyncTask

查看:109
本文介绍了完成AsyncTask的后onPostExecute不叫的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于某种原因,我的 onPostExecute()后,我的的AsyncTask 完成不叫。

For some reason my onPostExecute() is not called after my AsyncTask finishes.

我的类decleration:

My class decleration:

公共类setWallpaperForeground扩展的AsyncTask<字符串,整数,布尔>

我onPostExecute():

My onPostExecute():

保护无效onPostExecute(布尔结果)

一切工作正常,我的 doInBackground()成功完成,并返回一个布尔但它只是结束。

Everything works fine, my doInBackground() completes successfully and returns a Boolean but then it just finishes.

感谢

推荐答案

你创建的AsyncTask在UI线程?同时您onPostExecute()方法中添加一个@Override annotaiton,以确保正确声明的。

Did you create your AsyncTask on the UI thread? Also add an @Override annotaiton on your onPostExecute() method to make sure you declared it correctly.

这篇关于完成AsyncTask的后onPostExecute不叫的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆