Android Open Source - bankomatinfos List Adapter Infos

From Project

Back to project page bankomatinfos.


The source code is released under:

GNU General Public License

If you think the Android project bankomatinfos 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

 * /*from   w ww  .java  2 s.  c  o m*/
package at.zweng.bankomatinfos.ui;

import java.util.List;

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 at.zweng.bankomatinfos.AppController;
import at.zweng.bankomatinfos.model.InfoKeyValuePair;
import at.zweng.bankomatinfos2.R;

 * Custom list adapter for the card infos list (first tab page
 * @author Johannes Zweng <>
public class ListAdapterInfos extends BaseAdapter {

  private Context _context;
  private List<InfoKeyValuePair> _infoList;

   * Constructor
  public ListAdapterInfos(Context ctx) {
    this._context = ctx;
    this._infoList = AppController.getInstance().getCardInfoNullSafe(ctx)

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

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

  public long getItemId(int position) {
    // we simply use position in list as ID for events
    return position;

  public View getView(int position, View v, ViewGroup parent) {
    InfoKeyValuePair infoItem = _infoList.get(position);
    if (infoItem.isSectionHeader()) {
      LayoutInflater mInflater = (LayoutInflater) _context
      v = mInflater.inflate(R.layout.list_item_general_info_header, null);
    } else {
      LayoutInflater mInflater = (LayoutInflater) _context
      v = mInflater.inflate(R.layout.list_item_general_info, null);

    TextView infoLabel = (TextView) v.findViewById(;

    if (!infoItem.isSectionHeader()) {
      TextView infoValue = (TextView) v
    return v;


Java Source Code List