diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2017-04-10 21:34:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-10 21:34:12 +0200 |
commit | 001290f78326586bd78b46d0b8f219a2b090b3df (patch) | |
tree | 97951504cb551866dd8ad9da3451d7399af5f59e /app | |
parent | 25a8334acae4cafa4e615729a07a1f1748d6d55a (diff) | |
parent | 77e89b57864fadc8292abf3c39a9678e952999d6 (diff) | |
download | AntennaPod-001290f78326586bd78b46d0b8f219a2b090b3df.zip |
Merge pull request #2287 from mfietz/2275-share-opml
Share OPML [Fixed]
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/AndroidManifest.xml | 16 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/OpmlImportFromIntentActivity.java | 17 |
2 files changed, 27 insertions, 6 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 2049b6bae..d9638e705 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -191,6 +191,21 @@ <data android:host="*"/> </intent-filter> + <intent-filter> + <action android:name="android.intent.action.SEND"/> + + <category android:name="android.intent.category.DEFAULT"/> + <category android:name="android.intent.category.BROWSABLE"/> + + <data android:mimeType="text/xml"/> + <data android:mimeType="text/plain"/> + <data android:mimeType="text/x-opml"/> + <data android:mimeType="application/xml"/> + <data android:mimeType="application/octet-stream"/> + + <data android:scheme="http"/> + <data android:scheme="https"/> + </intent-filter> </activity> <activity android:name=".activity.OpmlFeedChooserActivity" @@ -243,6 +258,7 @@ <data android:host="*"/> <data android:pathPattern=".*\\.xml"/> <data android:pathPattern=".*\\.rss"/> + <data android:pathPattern=".*\\.atom"/> </intent-filter> <!-- Feedburner URLs --> diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportFromIntentActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportFromIntentActivity.java index 02e16a7b5..4c94e2b76 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportFromIntentActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportFromIntentActivity.java @@ -1,25 +1,30 @@ package de.danoeh.antennapod.activity; +import android.content.Intent; import android.net.Uri; import android.os.Bundle; import de.danoeh.antennapod.core.preferences.UserPreferences; -/** Lets the user start the OPML-import process. */ +/** + * Lets the user start the OPML-import process. + */ public class OpmlImportFromIntentActivity extends OpmlImportBaseActivity { private static final String TAG = "OpmlImportFromIntentAct"; @Override - protected void onCreate(Bundle savedInstanceState) { - setTheme(UserPreferences.getTheme()); - super.onCreate(savedInstanceState); + protected void onCreate(Bundle savedInstanceState) { + setTheme(UserPreferences.getTheme()); + super.onCreate(savedInstanceState); - getSupportActionBar().setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); Uri uri = getIntent().getData(); - if(uri.toString().startsWith("/")) { + if (uri != null && uri.toString().startsWith("/")) { uri = Uri.parse("file://" + uri.toString()); + } else { + uri = Uri.parse(getIntent().getStringExtra(Intent.EXTRA_TEXT)); } importUri(uri); } |