Android Open Source - android-facade-example Station Data Adapter

From Project

Back to project page android-facade-example.


The source code is released under:

MIT License

If you think the Android project android-facade-example 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.ruenzuo.weatherapp.adapters;
//ww w .ja  v a  2  s .  c o  m
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.ruenzuo.weatherapp.R;

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

 * Created by ruenzuo on 10/05/14.
public class StationDataAdapter extends ArrayAdapter<String> {

    private int resourceId;
    private ArrayList<String> titles;

    public StationDataAdapter(Context context, int resource) {
        super(context, resource);
        resourceId = resource;
        titles =  new ArrayList<String>(Arrays.asList(context.getResources().getStringArray(R.array.titles)));

    public boolean isEnabled(int position) {
        return false;

    public View getView(int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            LayoutInflater inflater = ((Activity)getContext()).getLayoutInflater();
            convertView = inflater.inflate(resourceId, null);
        String value = getItem(position);
        TextView txtViewValueTitle = (TextView) convertView.findViewById(;
        TextView txtViewValue = (TextView) convertView.findViewById(;
        return convertView;


Java Source Code List