Android Open Source - HRForecast-WFM Custom Adapter

From Project

Back to project page HRForecast-WFM.


The source code is released under:

Copyright 2014 Ahmed Shafei

If you think the Android project HRForecast-WFM 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 de.hrf.workforcemanagement;
//  w  w  w. j a v  a  2 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.CheckBox;
import android.widget.TextView;

public class CustomAdapter extends ArrayAdapter<RowModel> {
  RowModel[] modelItems = null;
  Context context;

  public CustomAdapter(Context context, RowModel[] resource) {
    super(context, R.layout.row, resource);
    // TODO Auto-generated constructor stub
    this.context = context;
    this.modelItems = resource;

  public View getView(int position, View convertView, ViewGroup parent) {
    // TODO Auto-generated method stub
    LayoutInflater inflater = ((Activity) context).getLayoutInflater();
    convertView = inflater.inflate(R.layout.row, parent, false);
    TextView name = (TextView) convertView.findViewById(;
    CheckBox cb = (CheckBox) convertView.findViewById(;
    if (modelItems[position].getValue() == 1)
    return convertView;

Java Source Code List