Skip to content

Commit

Permalink
Update MainActivity.java
Browse files Browse the repository at this point in the history
  • Loading branch information
botbahlul authored Mar 19, 2023
1 parent 0a494a7 commit 6b430b7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/src/main/java/com/android/autosrt/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1279,12 +1279,10 @@ else if(ContentResolver.SCHEME_CONTENT.equals(uri.getScheme())) {
if(authority.equals("media")) {
idStr = uri.toString().substring(uri.toString().lastIndexOf('/') + 1);
System.out.println("media idStr = " + idStr);
return idStr;
}
else if(authority.startsWith("com.android.providers")) {
idStr = DocumentsContract.getDocumentId(uri).split(":")[1];
System.out.println("providers idStr = " + idStr);
return idStr;
}

ContentResolver contentResolver = context.getContentResolver();
Expand All @@ -1293,7 +1291,7 @@ else if(authority.startsWith("com.android.providers")) {
"_id=?",
new String[]{idStr}, null);
if (cursor != null && cursor.getCount()>0 && cursor.moveToFirst()) {
//cursor.moveToFirst();
cursor.moveToFirst();
try {
int idx = cursor.getColumnIndex(MediaStore.Files.FileColumns.DATA);
System.out.println("cursor.getString(idx) = " + cursor.getString(idx));
Expand Down

0 comments on commit 6b430b7

Please sign in to comment.