Merge pull request #7862 from jensMF/fix_getNameFromContentUri

fixed getNameFromContentUri fixes #7624 and #6598
This commit is contained in:
max-klaus 2019-11-06 10:47:27 +03:00 committed by GitHub
commit 10098c9ae2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -164,7 +164,7 @@ public class ImportHelper {
private String getNameFromContentUri(Uri contentUri) { private String getNameFromContentUri(Uri contentUri) {
final String name; final String name;
final Cursor returnCursor = app.getContentResolver().query(contentUri, null, null, null, null); final Cursor returnCursor = app.getContentResolver().query(contentUri, new String[] {OpenableColumns.DISPLAY_NAME}, null, null, null);
if (returnCursor != null && returnCursor.moveToFirst()) { if (returnCursor != null && returnCursor.moveToFirst()) {
int columnIndex = returnCursor.getColumnIndex(OpenableColumns.DISPLAY_NAME); int columnIndex = returnCursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
if (columnIndex != -1) { if (columnIndex != -1) {