Android Open Source - digital-ocean-swimmer Account Adapter

From Project

Back to project page digital-ocean-swimmer.


The source code is released under:

MIT License

If you think the Android project digital-ocean-swimmer 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.yassirh.digitalocean.ui;
/*from   w  w  w.  jav  a  2s  .  c  o  m*/
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 com.yassirh.digitalocean.R;
import com.yassirh.digitalocean.model.Account;

public class AccountAdapter extends BaseAdapter {
    private List<Account> data;
    private static LayoutInflater inflater=null;
    public AccountAdapter(Context context, List<Account> data) {;
        inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

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

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

    public long getItemId(int position) {
      return data.get(position).getId();
    public View getView(int position, View convertView, ViewGroup parent) {
        View vi=convertView;
            vi = inflater.inflate(R.layout.account_list_row, parent, false);

        Account account = data.get(position);
        TextView nameTextView = (TextView)vi.findViewById(;
        return vi;

Java Source Code List