我的问题是我有两个课程,我想在ListView
. 我想将这些合并到一个列表视图中AsyncTask
,有我的代码,我需要帮助。
protected Void doInBackground(Void... params) {
twitt = Services.getTwitterTv();
twittns = Services.getTwitter();
return null;
}
@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
for (Twitter twitts : twitt)
for(Twitter twittn: twittns)
{
System.out.println(twitts.getTexte());
System.out.println(twittn.getTexte());
}
progressDialog.dismiss();
twitt.addAll(Services.getTwitter());
twitt.addAll(Services.getTwitterTv());
TwitterAdapter adapter = new TwitterAdapter(TwitterTv.this, R.layout.twitts_item, twitt );
TwitterAdapter adapter2 = new TwitterAdapter(TwitterTv.this, R.layout.twitts_item, twittns );
twitterlist.setAdapter(adapter);
twitterlist.setAdapter(adapter2);
}
}