Back to project page AndroidSectionHeaders.
The source code is released under:
Apache License
If you think the Android project AndroidSectionHeaders listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.marczych.androidsectionheaders.sample; /*from w ww . j a va 2 s . c om*/ import java.util.ArrayList; import com.marczych.androidsectionheaders.*; import android.app.Activity; import android.os.Bundle; public class SectionHeadersSampleActivity extends Activity { private SectionListView mListView; private SectionHeadersAdapter mAdapter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.section_headers); mListView = (SectionListView)findViewById(R.id.section_list); mAdapter = getSectionAdapter(); mListView.setAdapter(mAdapter); mListView.getListView().setOnItemClickListener(mAdapter); } private SectionHeadersAdapter getSectionAdapter() { SectionHeadersAdapter adapter = new SectionHeadersAdapter(); for (int i = 0; i < 10; i ++) { adapter.addSection(new SampleSectionAdapter(this, getSampleList(), "Header #" + i)); } return adapter; } private ArrayList<String> getSampleList() { ArrayList<String> list = new ArrayList<String>(); for (int i = 0; i < 10; i ++) { list.add("List item #" + i); } return list; } }