I'm currently using the master / detail flow in my android application project. Now I would like to not only create a list with items with only one string. I'd like to change the standard DummyItem class to the following:
/** * A dummy item representing a piece of content. */ public static class DummyItem { public String id; public String content; public String subtext; //Added subtext variable here public DummyItem(String id, String content, String subtext) { this.id = id; this.content = content; this.subtext = subtext; //And here } @Override public String toString() { return content; } }
In the ItemListFragment class I'm having this line of code pre-defined for creating the adapter for the list:
setListAdapter(new ArrayAdapter<DummyContent.DummyItem>(getActivity(), android.R.layout.simple_list_item_activated_1, android.R.id.text1, DummyContent.ITEMS));
But I would like to change the android.R.layout.simple_list_item_activated_1
to android.R.layout.simple_list_item_activated_2
while having android.R.id.text1
as content and android.R.id.text2
as my subtext
-variable.
Is there a possibility to do this?