我有一個數據搜索我的android應用程序和調試通過控制檯,當我檢查控制檯時,我看到doInBackground
工作正常,但它沒有調用onPostExecute
後。我不知道是因爲什麼,有人可以幫忙嗎?OnPostExecute不會調用doInBackground後成功
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
的作品。