Back to project page HastingsMobileAndroid.
The source code is released under:
Apache License
If you think the Android project HastingsMobileAndroid 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 edu.hastings.hastingscollege.adapter; /* ww w. j a va 2 s . c o m*/ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import java.util.ArrayList; import edu.hastings.hastingscollege.R; public class CustomEContactsAdapter extends BaseAdapter { private static final String TAG = CustomEContactsAdapter.class.getSimpleName(); ArrayList<ContactsDataModel> listArray; public CustomEContactsAdapter(ArrayList<ContactsDataModel> contactsDataModelArrayList) { this.listArray = contactsDataModelArrayList; } @Override public int getCount() { return listArray.size(); } @Override public Object getItem(int position) { return listArray.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, final ViewGroup parent) { if (convertView == null) { LayoutInflater inflater = LayoutInflater.from(parent.getContext()); convertView = inflater.inflate(R.layout.list_item_econtacts, parent, false); } final ContactsDataModel dataModel = listArray.get(position); TextView contactName = (TextView) convertView.findViewById(R.id.contact_name); contactName.setText(dataModel.getContactName()); TextView contactNum = (TextView) convertView.findViewById(R.id.phone_num); contactNum.setText(dataModel.getContactPhoneNumber()); return convertView; } }