This tutorial – http://andytsui.wordpress.com/2011/06/29/tutorial-displaying-multiple-lists-in-one-single-listview-with-android-binding/ – shows exactly what I want to do, but it uses an external library to accomplish it. I was hoping it would be possible to do it with the built in android utilities.
This is what I have now. >> https://i.stack.imgur.com/hwplv.png
foobar.zip, links.zip, and zips.zip come from the bootimg402 link, and I would like them displayed under that header, and the other zips under the other heading.
Headers are created with
mURLURLS = new String[] {"http://rootzwiki.com/topic/12083-unsecured-stock-bootimg402/", "http://rootzwiki.com/topic/12451-rom-android-open-kang-project-toro-build-2012-dec-31/"};
for (int i=0; i<mURLURLS.length; i++) {
getListView().addHeaderView(buildHeader(mURLURLS[i]));
}
private View buildHeader(String mURLURLS) {
TextView header = new TextView(this);
header.setText(mURLURLS);
header.setBackgroundResource(R.drawable.dialog_full_holo_dark);
header.setTextColor(getResources().getColor(R.color.ics));
return header;
}
And the listview is populated through an ArrayList, which I can provide if needed, though I dont imagine its necessary.
You can use my
MergeAdapterfor that. Create views for your headers and interleave them between your adapters for the contents within those headers.