Urls can now be sent to addfeedactivity from other apps

This commit is contained in:
daniel oeh 2012-07-14 12:08:48 +02:00
parent cbeeaa3766
commit bbcdeecc40
2 changed files with 17 additions and 1 deletions

View File

@ -30,7 +30,13 @@
</activity> </activity>
<activity <activity
android:name="de.danoeh.antennapod.activity.AddFeedActivity" android:name="de.danoeh.antennapod.activity.AddFeedActivity"
android:label="@string/add_new_feed_label" /> android:label="@string/add_new_feed_label" >
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/plain"/>
</intent-filter>
</activity>
<activity <activity
android:name="de.danoeh.antennapod.activity.FeedItemlistActivity" android:name="de.danoeh.antennapod.activity.FeedItemlistActivity"
android:configChanges="orientation|screenSize" /> android:configChanges="orientation|screenSize" />

View File

@ -101,6 +101,16 @@ public class AddFeedActivity extends SherlockActivity {
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
StorageUtils.checkStorageAvailability(this); StorageUtils.checkStorageAvailability(this);
Intent intent = getIntent();
if (intent.getAction() != null && intent.getAction().equals(Intent.ACTION_SEND)) {
Log.d(TAG, "Was started with ACTION_SEND intent");
String text = intent.getStringExtra(Intent.EXTRA_TEXT);
if (text != null) {
etxtFeedurl.setText(text);
} else {
Log.d(TAG, "No text was sent");
}
}
} }