From f7c8978c7931855d17a6f2ac74dfb154507bb3dc Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Thu, 22 Oct 2015 21:43:52 -0700 Subject: [PATCH] Ensure that path stack has an absolute path --- .../main/java/org/deadc0de/apple2ix/Apple2DisksMenu.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Android/app/src/main/java/org/deadc0de/apple2ix/Apple2DisksMenu.java b/Android/app/src/main/java/org/deadc0de/apple2ix/Apple2DisksMenu.java index 225dd89a..d1e3e007 100644 --- a/Android/app/src/main/java/org/deadc0de/apple2ix/Apple2DisksMenu.java +++ b/Android/app/src/main/java/org/deadc0de/apple2ix/Apple2DisksMenu.java @@ -492,13 +492,20 @@ public class Apple2DisksMenu implements Apple2MenuView { } }; + final String parentDisksDir = disksDir; + final boolean parentIsRootPath = isRootPath; + disksList.setAdapter(adapter); disksList.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, final int position, long id) { if (isDirectory[position]) { Log.d(TAG, "Descending to path : " + fileNames[position]); - pushPathStack(fileNames[position]); + if (parentIsRootPath && !new File(fileNames[position]).isAbsolute()) { + pushPathStack(parentDisksDir + File.separator + fileNames[position]); + } else { + pushPathStack(fileNames[position]); + } dynamicSetup(); ListView disksList = (ListView) mDisksView.findViewById(R.id.listView_settings); disksList.postInvalidate();