Skip to content

Commit

Permalink
fix camera nullpointerexception
Browse files Browse the repository at this point in the history
remove deletefile
  • Loading branch information
guiguegon committed Jul 27, 2016
1 parent 8e1eccc commit 4ef6dbc
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,17 @@ public GalleryMedia onGetPictureIntentResults(final int requestCode, final int r
if (resultCode == Activity.RESULT_OK) {
galleryAddPic(mediaUri);
return new GalleryMedia().setMediaUri(mediaUri.getPath()).setMimeType(mimeType);
} else {
FileUtils.deleteFile(context.getContentResolver(), mediaUri);
}
}
return null;
}

private void galleryAddPic(Uri mediaUri) {
Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
mediaScanIntent.setData(mediaUri);
context.sendBroadcast(mediaScanIntent);
if (context != null) {
Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
mediaScanIntent.setData(mediaUri);
context.sendBroadcast(mediaScanIntent);
}
}
}

0 comments on commit 4ef6dbc

Please sign in to comment.