Open BroadcastGames opened 7 years ago
It's also notable that the dataDirectory() method in Paths.java seems to make assumptions about the file layout that experience shows are not always safe to make.
Paths.java line 34 in particular: https://github.com/retrobits/son_of_hunkypunk/blob/master/app/src/main/java/org/andglkmod/hunkypunk/Paths.java#L34
File f = new File(cardDirectory(), "Android/data/org.andglkmod.hunkypunk")
This starts with "cardDirectory()" which is defined to be the external SD Card. On devices with a physical removable SD Card this can be a rather different layout than the expected. Then it goes further to assume a relative path to the data of the app. Methods like coverDirectory() build upon this path. The layout between Android 4.4, Android 5.0, and Android 6.0+ can all be rather different in the construction of the path. Then various OEM's like Samsung/Sony/LG can have their own unique arrangements.
On Android 7.0 Nexus 6. To reproduce the problem:
The problem is that the Activity onCreate does not read from SharedPreferences and uses the default folder name. Once you rotate the screen or go into Preferences and close Preferences it does read it.
The preferences are read in onResume, which is why rotating the screen causes the path to change. Here is a link to the relevant code: https://github.com/retrobits/son_of_hunkypunk/blob/master/app/src/main/java/org/andglkmod/hunkypunk/GamesList.java#L113