diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/FileListItem.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/FileListItem.java index 69b39438e8..b9c8a571cf 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/FileListItem.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/FileListItem.java @@ -22,6 +22,7 @@ public class FileListItem implements Comparable public FileListItem(File file) { mPath = file.getAbsolutePath(); + mFilename = file.getName(); if (file.isDirectory()) { @@ -29,23 +30,32 @@ public class FileListItem implements Comparable } else { - String fileExtension = mPath.substring(mPath.lastIndexOf('.')); + String fileExtension = null; - // Extensions to filter by. - Set allowedExtensions = new HashSet(Arrays.asList(".dff", ".dol", ".elf", ".gcm", ".gcz", ".iso", ".wad", ".wbfs")); - - // Check that the file has an appropriate extension before trying to read out of it. - if (allowedExtensions.contains(fileExtension)) + int extensionStart = mPath.lastIndexOf('.'); + if (extensionStart < 1) { - mType = NativeLibrary.IsWiiTitle(mPath) ? TYPE_WII : TYPE_GC; + // Ignore hidden files & files without extensions. + mType = TYPE_OTHER; } else { - mType = TYPE_OTHER; + fileExtension = mPath.substring(extensionStart); + + // The extensions we care about. + Set allowedExtensions = new HashSet(Arrays.asList(".dff", ".dol", ".elf", ".gcm", ".gcz", ".iso", ".wad", ".wbfs")); + + // Check that the file has an extension we care about before trying to read out of it. + if (allowedExtensions.contains(fileExtension)) + { + mType = NativeLibrary.IsWiiTitle(mPath) ? TYPE_WII : TYPE_GC; + } + else + { + mType = TYPE_OTHER; + } } } - - mFilename = file.getName(); } public int getType() diff --git a/Source/Android/code-style-java.jar b/Source/Android/code-style-java.jar index 8140ad66f9..04a041c048 100644 Binary files a/Source/Android/code-style-java.jar and b/Source/Android/code-style-java.jar differ