diff --git a/DroidFishApp/src/main/java/org/petero/droidfish/activities/EditPGN.java b/DroidFishApp/src/main/java/org/petero/droidfish/activities/EditPGN.java index 02d56cd..bea3681 100644 --- a/DroidFishApp/src/main/java/org/petero/droidfish/activities/EditPGN.java +++ b/DroidFishApp/src/main/java/org/petero/droidfish/activities/EditPGN.java @@ -272,7 +272,8 @@ public abstract class EditPGN extends AppCompatActivity { ListView lv = binding.listView; currentFilePos = defaultFilePos; int itemNo = getItemNo(gamesInFile, defaultFilePos); - lv.setSelectionFromTop(itemNo, 0); + if (itemNo >= 0) + lv.setSelectionFromTop(itemNo, 0); lv.setFastScrollEnabled(true); lv.setOnItemClickListener((parent, view, pos, id) -> { selectedGi = aa.getItem(pos);