Android Open Source - TextSpam Contact List Adapter

From Project

Back to project page TextSpam.


The source code is released under:

Apache License

If you think the Android project TextSpam 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 com.andrew749.textspam.Adapters;
//from  w ww . j av a2 s  . c o  m
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.andrew749.textspam.Custom;
import com.andrew749.textspam.R;

import java.util.ArrayList;

 * Created by andrew on 25/06/13.
public class ContactListAdapter extends ArrayAdapter<Custom> {
    private ArrayList<Custom> entries;
    private Activity ac;

    public ContactListAdapter(Activity a, int textViewResourceId, ArrayList<Custom> list) {
        super(a, textViewResourceId, list);
        entries = list;
        ac = a;

    public View getView(int position, View convertView, ViewGroup parent) {
        View v = convertView;
        ViewHolder holder = null;
        if (v == null) {
            LayoutInflater vi =
                    (LayoutInflater) ac.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = vi.inflate(R.layout.listitem, parent, false);
            holder = new ViewHolder();
   = (TextView) v.findViewById(;
        } else {
            holder = (ViewHolder) v.getTag();

        Custom numbers = entries.get(position);
        if (numbers != null) {
  "" + numbers.getPhoneNumber());
        return v;

    public class ViewHolder {
        TextView tv;

Java Source Code List