0

I am using two different lists because I need information from both. the getItem(position) gets the item from the mChampionList so I can retrieve the ID and look up the champion from the mChampionListSTATIC list. The first time it calls getView(), mChampionListSTATIC is populated and I can get the information needed. But after that, mChampionListSTATIC is null.

@Override
    public View getView(int position, View convertView, ViewGroup parent) {
    ///
    //holder stuff happens here, removed it to save space//
    ///
        Champion champion = getItem(position);
        Champion_STATIC championSTATIC = mChampionListSTATIC.getChampionById(champion.getId());
        holder.icon.setImageResource(mContext.getResources().getIdentifier(championSTATIC.getName().toLowerCase(), "drawable", mContext.getPackageName()));
        holder.name.setText(championSTATIC.getName());

        return convertView;
    }
DDukesterman
  • 1,391
  • 5
  • 24
  • 42
  • You are sure it's mChampionListSTATIC that is null and not something else? Maybe championSTATIC is the thing that is null because it was not found in the list? – Karakuri Apr 24 '14 at 17:37
  • The mChampionListSTATIC is null, not that position. The first time getView() is called, it is for the first item in the list and mChampionListSTATIC is not null – DDukesterman Apr 24 '14 at 18:37

0 Answers0