Back to project page ProjectStudio.
The source code is released under:
Apache License
If you think the Android project ProjectStudio 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 adapters; //w w w . j ava 2 s. co m import android.app.Activity; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import com.example.uniutilproject.R; public class HomeCardAdapter extends BaseAdapter { private Context context; private String values[]; public HomeCardAdapter(Context context, String[] values) { this.context = context; this.values = values; } @Override public int getCount() { return values.length; } @Override public Object getItem(int position) { return values[position]; } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { LayoutInflater mInflater = (LayoutInflater) context .getSystemService(Activity.LAYOUT_INFLATER_SERVICE); convertView = mInflater.inflate(R.layout.home_listitem, null); } /* TextView card_content = (TextView) convertView.findViewById(R.id.homecard_content); TextView card_date = (TextView) convertView.findViewById(R.id.homecard_date); card_content.setText(getItem(position).toString()); card_date.setText(getItem(position).toString()); */ return convertView; } }