udacity / Android_Me

App that lets you style your own Android! This uses Fragments to create a flexible and responsive UI.
261 stars 1.01k forks source link

check should be on the index not on the list of ids #45

Open GuidoCasati opened 6 years ago

GuidoCasati commented 6 years ago

if(mListIndex < mListImagesIds.size()) imageView.setImageResource(mListImagesIds.get(mListIndex));

alwarren commented 6 years ago

Not sure what you're suggesting but this is a range check after the previous increment. It tests the index against the size of the list. It should be if(mListIndex < mImageIds.size()-1)