Allow sending newly exported data

With this change once data is exported it can be sent to
another application.

Translation contributions:
Clonewayx: cs
PanderMusubi: nl
pbeckmann: de
Airon90: it
arno-github : fr

# Conflicts:
#	app/src/main/res/values-it/strings.xml
This commit is contained in:
Branden Archer
2017-01-16 22:06:13 -05:00
parent eeb41376c5
commit b38e035fb6
8 changed files with 32 additions and 2 deletions

View File

@@ -250,7 +250,7 @@ public class ImportExportActivity extends AppCompatActivity
builder.create().show();
}
private void onExportComplete(boolean success, File path)
private void onExportComplete(boolean success, final File path)
{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
@@ -277,6 +277,28 @@ public class ImportExportActivity extends AppCompatActivity
}
});
if(success)
{
final CharSequence sendLabel = ImportExportActivity.this.getResources().getText(R.string.sendLabel);
builder.setPositiveButton(sendLabel, new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
Uri outputUri = Uri.fromFile(path);
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, outputUri);
sendIntent.setType("text/plain");
ImportExportActivity.this.startActivity(Intent.createChooser(sendIntent,
sendLabel));
dialog.dismiss();
}
});
}
builder.create().show();
}