Android Open Source - groundify-android My Spinner 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;
/*from  w ww . ja v  a  2s.  c o m*/
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 MySpinnerAdapter extends BaseAdapter {

  private ArrayList<String> childFirstNameList;
  private Context current;
  private LayoutInflater inflater;

  public MySpinnerAdapter(Context con, ArrayList<String> childFirstNameList) {

    this.current = con;
    this.childFirstNameList = childFirstNameList;

    inflater = (LayoutInflater) current


  public int getCount() {
    // TODO Auto-generated method stub
    return childFirstNameList.size();

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

  public long getItemId(int position) {
    // TODO Auto-generated method stub
    return position;

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

    ViewHolder holder;

    if (convertView == null) {

      convertView = inflater.inflate(R.layout.listinflate, null);
      holder = new ViewHolder();
      holder.listinflate_textView = (TextView) convertView

    } else {
      holder = (ViewHolder) convertView.getTag();


    return convertView;


  private class ViewHolder {

    TextView listinflate_textView;


Java Source Code List