protected void onPostExecute(Exception result) {
super.onPostExecute(result);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(MainActivity.this ,android.R.layout.simple_list_item_2,titles);
//I want also to give the dates beside titles but it is giving me error
lvRss.setAdapter(adapter);
progressDialog.dismiss();
}
我使用android.R.layout.simple_list_item_2
来获取两个textView但是如何初始化第二个?
答案 0 :(得分:0)
使用下面的ListAdapter
或使用CustomAdpater
ListAdapter listAdapter = new SimpleCursorAdapter(
this,
android.R.layout.simple_list_item_2,
mCursor,
new String[] {"", ""},
new int[] {android.R.id.text1, android.R.id.text2});
setListAdapter(adapter);
希望它有所帮助!