onPostExecute not called after completion AsyncTask(完成 AsyncTask 后未调用 onPostExecute)
问题描述
由于某种原因,我的 AsyncTask
完成后没有调用我的 onPostExecute()
.
For some reason my onPostExecute()
is not called after my AsyncTask
finishes.
我的类声明:
public class setWallpaperForeground extends AsyncTask
我的 onPostExecute():
My onPostExecute():
protected void onPostExecute(Boolean result)
一切正常,我的 doInBackground()
成功完成并返回一个布尔值,但它刚刚完成.
Everything works fine, my doInBackground()
completes successfully and returns a Boolean but then it just finishes.
谢谢
推荐答案
您是否在 UI 线程上创建了 AsyncTask?还要在 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:完成 AsyncTask 后未调用 onPostExecute


基础教程推荐
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01