package fr.tvbarthel.apps.simpleweatherforcast.ui;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import java.util.List;

import fr.tvbarthel.apps.simpleweatherforcast.R;
import fr.tvbarthel.apps.simpleweatherforcast.model.App;

public class MoreAppsAdapter extends ArrayAdapter<App> {


    public MoreAppsAdapter(Context context, List<App> apps) {
        super(context, R.layout.row_more_apps, apps);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        RelativeLayout appView = (RelativeLayout) convertView;
        App app = getItem(position);

        if (appView == null) {
            LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            appView = (RelativeLayout) inflater.inflate(R.layout.row_more_apps, parent, false);
        }

        ((TextView) appView.findViewById(R.id.row_more_apps_name)).setText(app.getNameResourceId());
        ((ImageView) appView.findViewById(R.id.row_more_apps_logo)).setImageResource(app.getLogoResourceId());

        return appView;
    }
}

@@ -1072,20 +1072,79 @@
     
-%7D%0A%0A        (
+    ViewHolder holder = new ViewHolder();%0A            holder.appName = 
 (Tex
@@ -1199,53 +1199,39 @@
 ame)
-).setText(app.getNameResourceId());%0A        (
+;%0A            holder.appLogo = 
 (Ima
@@ -1287,76 +1287,360 @@
 ogo)
-).setImageResource(app.getLogoResourceId());%0A%0A        return appView
+;%0A            appView.setTag(holder);%0A        %7D%0A%0A        ViewHolder holder = (ViewHolder) appView.getTag();%0A        holder.appName.setText(app.getNameResourceId());%0A        holder.appLogo.setImageResource(app.getLogoResourceId());%0A%0A        return appView;%0A    %7D%0A%0A    private static class ViewHolder %7B%0A        TextView appName;%0A        ImageView appLogo
 ;%0A  

Use a view holder pattern