Android Open Source - steam-sales-mobile Custom Array Adapter

From Project

Back to project page steam-sales-mobile.


The source code is released under:

GNU General Public License

If you think the Android project steam-sales-mobile 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

Steam Sales Mobile - Android application to keep track of the steam sales.
        Copyright (C) 2013  Mathieu Rhaume <>
//from  w  w  w .jav  a  2  s.  c  o m
        This program is free software: you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation, either version 3 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        GNU General Public License for more details.

package com.codingrhemes.steamsalesmobile;

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.TextView;

import java.util.List;

public class CustomArrayAdapter extends ArrayAdapter<Game> {
    private final LayoutInflater mInflater;

    public CustomArrayAdapter(Context context) {
        super(context, android.R.layout.simple_list_item_2);
        mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    public void setData(List<Game> myGames) {
        if (myGames != null) {
            for (Game appEntry : myGames) {

     * Populate new games in the list.
    public View getView(int position, View convertView, ViewGroup parent) {
        View view;

        if (convertView == null) {
            view = mInflater.inflate(R.layout.fragment_game_sales, parent, false);
        } else {
            view = convertView;

        Game item = getItem(position);
        // Getting the imageview then downloading the thumbnail in a thread.
        ((ImageView) view.findViewById(;
        // Setting the text views
        ((TextView) view.findViewById(;
        ((TextView) view.findViewById(;
        return view;

Java Source Code List