Back to project page MassRoute.
The source code is released under:
Copyright (c) 2010 Todd Anderson http://www.custardbelly.com/blog Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (th...
If you think the Android project MassRoute 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 com.custardbelly.massdot.view.adapter; //from ww w .j a v a 2 s .co m import java.util.List; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; import com.custardbelly.massdot.R; import com.custardbelly.massdot.model.RouteStop; public class RouteStopsAdapter extends ArrayAdapter<RouteStop> { private LayoutInflater inflater; private int rowViewResource; private List<RouteStop> stops; public RouteStopsAdapter( Context context, int rowViewResource, List<RouteStop> stops ) { super( context, rowViewResource, stops ); this.stops = stops; this.rowViewResource = rowViewResource; this.inflater = LayoutInflater.from( context ); } @Override public View getView( int position, View convertView, ViewGroup parent ) { View view = convertView; RouteStop stop = stops.get( position ); if( view == null ) { view = inflater.inflate( rowViewResource, null ); } if( stop != null ) { TextView titleView = (TextView) view.findViewById(R.id.stopTitle); if( titleView != null ) { titleView.setText( stop.getTitle() ); } } return view; } }