Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #679 updated realpath util method #697

Merged
merged 7 commits into from Apr 14, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/src/main/java/swati4star/createpdf/util/RealPathUtil.java
Expand Up @@ -47,6 +47,9 @@ public static String getRealPathFromURI_API19(final Context context, final Uri u
if ("primary".equalsIgnoreCase(type)) {
return Environment.getExternalStorageDirectory() + "/" + split[1];
}
if ("home".equalsIgnoreCase(type)) {
return Environment.getExternalStorageDirectory() + "/" + split[1];
}

} else if (isDownloadsDocument(uri)) {

Expand All @@ -67,6 +70,10 @@ public static String getRealPathFromURI_API19(final Context context, final Uri u
}
}
}
} else {
StringBuilder path = new StringBuilder(uri.getPath());
path.insert(0, "/storage/emulated/0");
return path.toString();
}
return null;
}
Expand Down