我在我的 android 应用程序中搜索数据并通过控制台进行调试,当我检查控制台时,我看到doInBackground
工作正常,但在它没有调用onPostExecute
. 不知道是什么原因,有人可以帮忙吗?
protected List<Recipe> doInBackground(Void... params) {
try {
List<Recipe> recipes=RecipeService.getRecipes(context,"a");
if(recipes != null) android.util.Log.i(TAG,"encontrados");
return recipes;
} catch (java.io.IOException e) {
android.util.Log.e(TAG,e.getMessage(),e);
android.util.Log.i(TAG,"ta akiiiiii");
com.android.utils.AndroidUtils.AlertDialog(context,R.string.name_io);
}finally{
progresso.dismiss();
}
return null;
}
//Update a view
protected void OnPostExecute(List<Recipe> recipes) {
android.util.Log.i(TAG,"are here");
for (Recipe recipe : recipes) {
android.util.Log.i(TAG,"Carro: "+recipe.name);
}
}
这里的日志永远不会执行,请问有什么问题吗?的try
作品doInBackground
。