All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yy.androidlib.util.sdk.BaseAdapter Maven / Gradle / Ivy

There is a newer version: 1.0.5
Show newest version
package com.yy.androidlib.util.sdk;

import java.util.ArrayList;
import java.util.List;

public abstract class BaseAdapter extends android.widget.BaseAdapter {

    protected List items = new ArrayList();

    @Override
    public int getCount() {
        if (items == null) {
            return 0;
        } else {
            return items.size();
        }
    }

    @Override
    public T getItem(int i) {
        if (i < 0 || i >= items.size()) {
            return null;
        } else {
            return items.get(i);
        }
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    public void setItems(List data) {
        this.items = new ArrayList(data);
        notifyDataSetChanged();
    }

    public List getItems() {
        return items;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy