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.
package de.hrf.workforcemanagement; // w w w. j a v a 2 s . c o m import android.app.Activity; 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; } @Override 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(R.id.textView1); CheckBox cb = (CheckBox) convertView.findViewById(R.id.checkBox1); name.setText(modelItems[position].getName()); if (modelItems[position].getValue() == 1) cb.setChecked(true); else cb.setChecked(false); return convertView; } }