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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!