diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/GameListFragment.java b/Source/Android/src/org/dolphinemu/dolphinemu/GameListFragment.java index 13f66c1c83..8464eaea9c 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/GameListFragment.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/GameListFragment.java @@ -76,6 +76,21 @@ public final class GameListFragment extends Fragment } } Collections.sort(fls); + + // Remove any duplicate items from the list. + // We don't need to index these in the game list more than once. + // + // This works by comparing the paths of items in the file list for equality, + // so there should be no worries about accidentally removing a valid game. + for (int i = 0; i < fls.size(); i++) + { + int indexNext = i+1; + + if (indexNext < fls.size() && fls.get(indexNext).getPath().contains(fls.get(i).getPath())) + { + fls.remove(indexNext); + } + } mGameAdapter = new GameListAdapter(mMe, R.layout.gamelist_layout, fls); mMainList.setAdapter(mGameAdapter);