Don't pass negative values to setSelectionFromTop()

This commit is contained in:
Peter Osterlund 2019-09-28 08:01:41 +02:00
parent 3ff78c2cbf
commit 8e42ee8022

View File

@ -272,6 +272,7 @@ public abstract class EditPGN extends AppCompatActivity {
ListView lv = binding.listView;
currentFilePos = defaultFilePos;
int itemNo = getItemNo(gamesInFile, defaultFilePos);
if (itemNo >= 0)
lv.setSelectionFromTop(itemNo, 0);
lv.setFastScrollEnabled(true);
lv.setOnItemClickListener((parent, view, pos, id) -> {