Android Open Source - BikeStation Bikes Adapter

From Project

Back to project page BikeStation.


The source code is released under:

GNU General Public License

If you think the Android project BikeStation 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  www  . j a  va  2 s  . c o  m*/
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;


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

public class BikesAdapter extends BaseAdapter {

    private List<String> bikes;
    private final Activity context;

    public BikesAdapter(Activity context) {
        this.context = context;
        bikes = new ArrayList<String>();

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

    public Object getItem(int i) {
        return bikes.get(i);

    public long getItemId(int i) {
        return i;

    public View getView(int i, View view, ViewGroup viewGroup) {
        View rowView = view;
        if (rowView == null) {
            LayoutInflater inflater = context.getLayoutInflater();
            rowView = inflater.inflate(R.layout.item_bike, null, true);
        TextView tvAccountName = (TextView)rowView.findViewById(;
        return rowView;

    public void addBike(String bike){


Java Source Code List