Android get file extension 取得文件的副檔名
筆記用途 // 取得文件的副檔名 private String getFileExtension(Uri uri) { ContentResolver contentResolver = getContentResolver(); MimeTypeMap mimeTypeMap = MimeTypeMap.getSingleton(); return mimeTypeMap.getExtensionFromMimeType(contentResolver.getType(uri)); } Done.