public View getView(int position, View convertView, ViewGroup parent)
    {
        mView = convertView;
        if (mView == null)
        {
            LayoutInflater viewInflator;
            viewInflator = LayoutInflater.from(mContext);
            mView = viewInflator.inflate(R.layout.adapter_category_tile, null);
        }
        //TODO add a view holder
        mCaptionTextView = (TextView) mView.findViewById(R.id.month_analytics_top_category_name);
        mCategoryImageView = (ImageView) mView.findViewById(R.id.month_analytics_top_category_image);
        mCategorySum = (TextView) mView.findViewById(R.id.month_analytics_top_category_sum);
        if(mCategoryList.get(position) != null)
        {
            String valueStr = Utils.sumAsCurrency(mCategoryList.get(position).mSecondField);
            int resIndex = mCategoryList.get(position).mFirstField;
            int resource = Images.getImageByPosition(resIndex, Images.getUnsorted());
            mCaptionTextView.setText(Images.getCaptionByImage(resource, Images.getSorted()));
            mCategoryImageView.setImageResource(resource);
            mCategorySum.setText(valueStr);
        }
        return mView;
    }
public View getView(int position, View convertView, ViewGroup parent)
    {
        mView = convertView;
        if (mView == null)
        {
            LayoutInflater viewInflator;
            viewInflator = LayoutInflater.from(mContext);
            mView = viewInflator.inflate(R.layout.adapter_category_tile, null);
        }
       
        mCaptionTextView = (TextView) mView.findViewById(R.id.month_analytics_top_category_name);
        mCategoryImageView = (ImageView) mView.findViewById(R.id.month_analytics_top_category_image);
        mCategorySum = (TextView) mView.findViewById(R.id.month_analytics_top_category_sum);
        if(mCategoryList.get(position) != null)
        {
            String valueStr = Utils.sumAsCurrency(mCategoryList.get(position).mSecondField);
            int resIndex = mCategoryList.get(position).mFirstField;
            int resource = Images.getImageByPosition(resIndex, Images.getUnsorted());
            mCaptionTextView.setText(Images.getCaptionByImage(resource, Images.getSorted()));
            mCategoryImageView.setImageResource(resource);
            mCategorySum.setText(valueStr);
        }
        return mView;
    }
public view getview(int position, view convertview, viewgroup parent) { mview = convertview; if (mview == null) { layoutinflater viewinflator; viewinflator = layoutinflater.from(mcontext); mview = viewinflator.inflate(r.layout.adapter_category_tile, null); } mcaptiontextview = (textview) mview.findviewbyid(r.id.month_analytics_top_category_name); mcategoryimageview = (imageview) mview.findviewbyid(r.id.month_analytics_top_category_image); mcategorysum = (textview) mview.findviewbyid(r.id.month_analytics_top_category_sum); if(mcategorylist.get(position) != null) { string valuestr = utils.sumascurrency(mcategorylist.get(position).msecondfield); int resindex = mcategorylist.get(position).mfirstfield; int resource = images.getimagebyposition(resindex, images.getunsorted()); mcaptiontextview.settext(images.getcaptionbyimage(resource, images.getsorted())); mcategoryimageview.setimageresource(resource); mcategorysum.settext(valuestr); } return mview; }