0
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();
}

I used android.R.layout.simple_list_item_2 to take two textViews but how to initialize the second one?

Banana
  • 2,435
  • 7
  • 34
  • 60
  • 1
    You have to create custom adapter. https://stackoverflow.com/questions/20755440/how-to-display-multiple-number-of-textviews-inside-each-row-in-listview – Rudrik Patel Feb 16 '18 at 11:39
  • okay I will check it..thank u..but my question, there is no way without a custom adapter? – Sandra Khazaal Feb 16 '18 at 13:02

1 Answers1

0

Use ListAdapter like below or Use 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);

Hope it helps!

Chithra B
  • 586
  • 2
  • 9