How to get the results from Map in postExecute method of AsyncTask ?

我只是一个虾纸丫 提交于 2019-12-02 14:23:19

String ar =results.get(i).get(commentModelList);

should be changed to

CommentModel ar =results.get(commentModelList).get(i);

To avoid confusion is the future try to separate each step into a different line:

List<CommentModel> resultList = results.get(commentModelList);
CommentModel ar = resultList.get(i);

EDIT: Also, where are you closing your for loop? If I understand what you are trying to do in your code correctly, you want to iterate over the list that you get from your map not iterate over your map to get the list. So it should be more like:

List<CommentModel> resultList = results.get(commentModelList);

for(int i=0;i<resultList.size();i++){
    CommentModel ar = resultList.get(i);

    // use 'ar' in the rest of your code
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!