Instanciation de mon adapter
adapterList = new AlphabeticalAdapter(this, mListNameStation);
Constructeur
1 2 3 4
| public AlphabeticalAdapter(Activity activity, List<String> pListStation) {
super(activity, 0, pListStation);
mListeStations = pListStation;
} |
getView de la classe AlphabeticalAdapter
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| public View getView(int position, View convertView, ViewGroup parent) {
Context activity = getContext();
View rowView;
if (convertView == null){
LayoutInflater inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
rowView = inflater.inflate(R.layout.alphabetical_list_item, null);
}
else{
rowView = convertView;
}
TextView textViewStationName = (TextView) rowView.findViewById(R.id.alphabetical_list_item_station_name);
//final Station mStation = mListeStations.get(position);
textViewStationName.setText(mListeStations.get(position));
LOGGER.error("Position : "+position);
//rowView.setOnClickListener(new MyListener(mStation));
return rowView;
} |
Partager