Back to project page AbstractGroupedAdapter.
The source code is released under:
Copyright (c) 2013 Aryan Ghassemi. All rights reserved. https://github.com/aryaxt/AbstractGroupedAdapter Permission is hereby granted, free of charge, to any person obtaining a copy of this software...
If you think the Android project AbstractGroupedAdapter 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.aryaxt.groupedadapter; //from w ww . j a v a 2 s . c o m import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; public class MyAdapter extends AbstractGroupedAdapter<String, Person> { public MyAdapter(Context context) { super(context); } @Override public View getView(int position, View view, ViewGroup parent) { if (this.isItemHeader(position)) { String header = this.getHeader(position); view = getReusableView(view, R.layout.header); TextView textView = (TextView) view.findViewById(R.id.txtHeaderTitle); textView.setText(header); } else { Person person = this.getItem(position); view = getReusableView(view, R.layout.row); TextView textView = (TextView) view.findViewById(R.id.txtPersonName); textView.setText(person.getName()); } return view; } }