Skip to content

Commit

Permalink
Fix: sharing export to 3rd-party service doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
codinguser committed Sep 28, 2015
1 parent ef74939 commit c140e9b
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ public void run() {

switch (mExportParams.getExportTarget()) {
case SHARING:
shareFile(mExportParams.getTargetFilepath());
File output = copyExportToSDCard();
shareFile(output.getAbsolutePath());
return true;

case DROPBOX:
Expand Down Expand Up @@ -379,15 +380,17 @@ private List<String> getExportedFiles() throws IOException {
/**
* Copies the exported file from the internal storage where it is generated to external storage
* which is accessible to the user
* @return File to which the export was copied
*/
private void copyExportToSDCard() {
private File copyExportToSDCard() {
Log.i(TAG, "Moving exported file to external storage");
File src = new File(mExportParams.getTargetFilepath());
File dst = Exporter.createExportFile(mExportParams.getExportFormat());

try {
copyFile(src, dst);
src.delete();
return dst;
} catch (IOException e) {
Crashlytics.logException(e);
Log.e(TAG, e.getMessage());
Expand Down

0 comments on commit c140e9b

Please sign in to comment.