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] android app crash when the saveImage method is called #211

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions src/android/PhotoLibraryService.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,18 +201,8 @@ public void saveImage(final Context context, final CordovaInterface cordova, fin
saveMedia(context, cordova, url, album, imageMimeToExtension, new FilePathRunnable() {
@Override
public void run(String filePath) {
try {
// Find the saved image in the library and return it as libraryItem
String whereClause = MediaStore.MediaColumns.DATA + " = \"" + filePath + "\"";
queryLibrary(context, whereClause, new ChunkResultRunnable() {
@Override
public void run(ArrayList<JSONObject> chunk, int chunkNum, boolean isLastChunk) {
completion.run(chunk.size() == 1 ? chunk.get(0) : null);
}
});
} catch (Exception e) {
completion.run(null);
}
JSONObject item = new JSONObject();
completion.run(item);
}
});

Expand Down