android - SimpleCursorAdapter / ListAdapter with Multiple Sources -
is possible build listadapter having elements come different sources (not 1 cursor).
// build list of names
// query table1.name
// query table2.name
// create listadapter passing in list of names.
here's example creating cursor single table:
simplecursoradapter adapter = new simplecursoradapter(this, android.r.layout.simple_list_item_1, cursor, new string[] { name }, new int[] { android.r.id.text1 }); setlistadapter(adapter); adapter.setfilterqueryprovider(m_filterqueryprovider); if (rememberlastconstraint && m_filterqueryprovider.getconstraint() != null) { adapter.getfilter().filter(m_filterqueryprovider.getconstraint()); }
one method compile data listview in data structure outside listview adapter , pass listview , called notify data set changed. way can data different type of sources listview.
Comments
Post a Comment