Android Open Source - android-facade-example Countries 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;
/*  w  w  w. j  ava 2s .  co  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 com.ruenzuo.weatherapp.models.Country;

 * Created by ruenzuo on 08/05/14.
public class CountriesAdapter extends ArrayAdapter<Country> {

    private int resourceId;

    public CountriesAdapter(Context context, int resource) {
        super(context, resource);
        resourceId = resource;

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


Java Source Code List