Added support for the Android 1.6 intent android.intent.action.SEND_MULTIPLE in a way that should work on older devices too. Worked fine in the Android 1.5 emulator.

Fixes issue 1210
This commit is contained in:
cketti 2010-04-02 01:43:56 +00:00
parent 5d18781156
commit f911b0e436
2 changed files with 4 additions and 6 deletions

View file

@ -191,13 +191,11 @@
<data android:mimeType="*/*" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!-- Use once we drop Android 1.5 support
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<data android:mimeType="*/*" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
-->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="mailto" />

View file

@ -390,7 +390,8 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
}
}
}
else if (Intent.ACTION_SEND.equals(action) /*|| Intent.ACTION_SEND_MULTIPLE.equals(action)*/)
//TODO: Use constant Intent.ACTION_SEND_MULTIPLE once we drop Android 1.5 support
else if (Intent.ACTION_SEND.equals(action) || "android.intent.action.SEND_MULTIPLE".equals(action))
{
/*
* Someone is trying to compose an email with an attachment, probably Pictures.
@ -409,8 +410,8 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
}
String type = intent.getType();
/* Use once we drop Android 1.5 support
if (Intent.ACTION_SEND_MULTIPLE.equals(action))
//TODO: Use constant Intent.ACTION_SEND_MULTIPLE once we drop Android 1.5 support
if ("android.intent.action.SEND_MULTIPLE".equals(action))
{
ArrayList<Parcelable> list = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
if (list != null)
@ -429,7 +430,6 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
}
}
else
*/
{
Uri stream = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM);
if (stream != null && type != null)