모델에서 getcontent() 메서드를 가져 오는 중이지만 메서드를 가져 오려고하면 null 값을 표시합니다.onPostExecute 메서드에서 결과를 얻는 방법
public class Gettingcomment extends AsyncTask<String,String,List<CommentModel>>{
@Override
protected List<CommentModel> doInBackground(String... params) {
String commenturl = params[0];
Populatecomments populatecomments =new Populatecomments();
// populatecomments.getCommentModelList(commenturl+mytrendinid);
Log.i("mytrendin",commenturl);
List<CommentModel> model= populatecomments.getCommentModelList(commenturl);
return model;
}
@Override
protected void onPostExecute(List<CommentModel> results) {
super.onPostExecute(results);
CommentModel commentModel = new CommentModel();
String content = commentModel.getContent();
Toast.makeText(getApplicationContext(),content,Toast.LENGTH_LONG).show();
}
}
이 빈약 한 질문인가? 누군가 부정적인 의견을 표했다. –