Android Open Source - attendance-viewer Custom List Adapter

From Project

Back to project page attendance-viewer.


The source code is released under:

MIT License

If you think the Android project attendance-viewer 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.juet.attendance;
/*from ww w . j a  v  a 2s.  co  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;

import com.juet.attendance.R;

public class CustomListAdapter extends BaseAdapter {

  private ArrayList<AttendanceValues> listData;

  private LayoutInflater layoutInflater;

  public CustomListAdapter(Context context, ArrayList<AttendanceValues> listData) {
    this.listData = listData;
    layoutInflater = LayoutInflater.from(context);

  public int getCount() {
    return listData.size();

  public Object getItem(int position) {
    return listData.get(position);

  public long getItemId(int position) {
    return position;

  public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder holder;
    if (convertView == null) {
      convertView = layoutInflater.inflate(R.layout.list_row_layout, null);
      holder = new ViewHolder();
      holder.subject = (TextView) convertView.findViewById(;
      holder.attendance = (TextView) convertView.findViewById(;
    } else {
      holder = (ViewHolder) convertView.getTag();
    return convertView;

  static class ViewHolder {
    TextView subject;
    TextView attendance;


Java Source Code List