diff options
author | Tom Hennen <tom.hennen@gmail.com> | 2015-09-07 15:20:48 -0400 |
---|---|---|
committer | Tom Hennen <tom.hennen@gmail.com> | 2015-09-07 15:20:48 -0400 |
commit | 0617115a6fc4a58a5870af5c3eaf5ca1358c803a (patch) | |
tree | deb74cac39314358059970f5515aa96745f83f0a | |
parent | 6780980b1ca1eba5305a51fd077d867ac6b0bf4d (diff) | |
download | AntennaPod-0617115a6fc4a58a5870af5c3eaf5ca1358c803a.zip |
export opml via intent
-rw-r--r-- | app/src/main/AndroidManifest.xml | 4 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/asynctask/OpmlExportWorker.java | 32 |
2 files changed, 18 insertions, 18 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 72e7752b1..117a008a8 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="de.danoeh.antennapod" - android:versionCode="1030204" - android:versionName="1.3.2"> + android:versionCode="1040000" + android:versionName="1.4.0.0"> <!-- Version code schema: "1.2.3-SNAPSHOT" -> 1020300 diff --git a/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlExportWorker.java b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlExportWorker.java index 6bba956a6..c9d82642e 100644 --- a/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlExportWorker.java +++ b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlExportWorker.java @@ -5,6 +5,8 @@ import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; +import android.content.Intent; +import android.net.Uri; import android.os.AsyncTask; import android.util.Log; @@ -76,26 +78,24 @@ public class OpmlExportWorker extends AsyncTask<Void, Void, Void> { @Override protected void onPostExecute(Void result) { progDialog.dismiss(); - AlertDialog.Builder alert = new AlertDialog.Builder(context) - .setNeutralButton(android.R.string.ok, - new DialogInterface.OnClickListener() { - - @Override - public void onClick(DialogInterface dialog, - int which) { - dialog.dismiss(); - } - }); if (exception != null) { + AlertDialog.Builder alert = new AlertDialog.Builder(context) + .setNeutralButton(android.R.string.ok, + (dialog, which) -> { + dialog.dismiss(); + }); alert.setTitle(R.string.export_error_label); alert.setMessage(exception.getMessage()); - } else { - alert.setTitle(R.string.opml_export_success_title); - alert.setMessage(context - .getString(R.string.opml_export_success_sum) - + output.toString()); + alert.create().show(); + return; } - alert.create().show(); + + Uri outputUri = Uri.fromFile(output); + Intent sendIntent = new Intent(Intent.ACTION_SEND); + sendIntent.putExtra(Intent.EXTRA_SUBJECT, "OPML Export"); + sendIntent.putExtra(Intent.EXTRA_STREAM, outputUri); + sendIntent.setType("text/plain"); + context.startActivity(Intent.createChooser(sendIntent, context.getResources().getText(R.string.share_label))); } @Override |