Android Open Source - groundify-android My Adapter

From Project

Back to project page groundify-android.


The source code is released under:

GNU General Public License

If you think the Android project groundify-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package custom.adapter.pckg;
/* w  w w.  j  a v  a  2  s . c om*/
import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class MyAdapter extends BaseAdapter {

  Context context;

  ArrayList<ChildDetail> childDetails;

  private final String TAG = "MyAdapter";

  public MyAdapter(ArrayList<ChildDetail> childDetailList, Context context) {
    // TODO Auto-generated constructor stub

    this.childDetails = childDetailList;

    this.context = context;

  public int getCount() {
    // TODO Auto-generated method stub

    return childDetails.size();

  public Object getItem(int position) {
    // TODO Auto-generated method stub
    return childDetails.get(position).getChildName();

  public long getItemId(int position) {
    // TODO Auto-generated method stub
    return Integer.parseInt(childDetails.get(position).getChildID());

  public View getView(int position, View convertView, ViewGroup parent) {
    // TODO Auto-generated method stub

    ViewHolder holder;

    LayoutInflater layoutInflater = (LayoutInflater) context

    if (convertView == null) {

      holder = new ViewHolder();

      convertView = layoutInflater.inflate(R.layout.listinflate, null);

      holder.text = (TextView) convertView




    else {

      holder = (ViewHolder) convertView.getTag();



    return convertView;

  public class ViewHolder {

    private TextView text;

Java Source Code List