diff --git a/res/menu/podfetcher.xml b/res/menu/podfetcher.xml index 5d37beba9..c1759882a 100644 --- a/res/menu/podfetcher.xml +++ b/res/menu/podfetcher.xml @@ -16,6 +16,7 @@ - + + diff --git a/src/de/danoeh/antennapod/activity/MainActivity.java b/src/de/danoeh/antennapod/activity/MainActivity.java index ad325d0d2..c98db63c8 100644 --- a/src/de/danoeh/antennapod/activity/MainActivity.java +++ b/src/de/danoeh/antennapod/activity/MainActivity.java @@ -18,6 +18,7 @@ import com.actionbarsherlock.view.MenuItem; import com.actionbarsherlock.view.Window; import com.viewpagerindicator.TabPageIndicator; +import de.danoeh.antennapod.asynctask.OpmlExportWorker; import de.danoeh.antennapod.feed.FeedManager; import de.danoeh.antennapod.fragment.FeedlistFragment; import de.danoeh.antennapod.fragment.QueueFragment; @@ -108,6 +109,9 @@ public class MainActivity extends SherlockFragmentActivity { case R.id.opml_import: startActivity(new Intent(this, OpmlImportActivity.class)); return true; + case R.id.opml_export: + new OpmlExportWorker(this).executeAsync(); + return false; case R.id.search_item: onSearchRequested(); return true; @@ -125,6 +129,9 @@ public class MainActivity extends SherlockFragmentActivity { } else { refreshAll.setVisible(true); } + + boolean hasFeeds = !manager.getFeeds().isEmpty(); + menu.findItem(R.id.opml_export).setVisible(hasFeeds); return true; } diff --git a/src/de/danoeh/antennapod/asynctask/OpmlExportWorker.java b/src/de/danoeh/antennapod/asynctask/OpmlExportWorker.java index 60493169a..ac3f994c6 100644 --- a/src/de/danoeh/antennapod/asynctask/OpmlExportWorker.java +++ b/src/de/danoeh/antennapod/asynctask/OpmlExportWorker.java @@ -19,7 +19,7 @@ import de.danoeh.antennapod.opml.OpmlWriter; /** Writes an OPML file into the export directory in the background. */ public class OpmlExportWorker extends AsyncTask { private static final String TAG = "OpmlExportWorker"; - private static final String DEFAULT_OUTPUT_NAME = "AntennaPod-Feeds.opml"; + private static final String DEFAULT_OUTPUT_NAME = "antennapod-feeds.opml"; private Context context; private File output;