我想從模型中獲取getcontent()方法,但是當我試圖獲取它顯示空值的方法時。如何在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();
}
}
這是窮人的問題?有人投反對票。 –