mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-25 15:11:52 -05:00
Fixed issue 160 - Applied a patch to enable K9 to respond to addtional SEND intents
This commit is contained in:
parent
ab82b10918
commit
46eef4589d
@ -132,6 +132,16 @@
|
|||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.SEND" />
|
||||||
|
<data android:mimeType="text/plain" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.SEND" />
|
||||||
|
<data android:mimeType="message/*" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
<data android:scheme="mailto" />
|
<data android:scheme="mailto" />
|
||||||
|
@ -389,8 +389,62 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
|||||||
addAttachment(stream);
|
addAttachment(stream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* There might be an EXTRA_SUBJECT, EXTRA_TEXT, EXTRA_EMAIL, EXTRA_BCC or EXTRA_CC
|
||||||
|
*/
|
||||||
|
|
||||||
|
String extraSubject = intent.getStringExtra(Intent.EXTRA_SUBJECT);
|
||||||
|
String extraText = intent.getStringExtra(Intent.EXTRA_TEXT);
|
||||||
|
String[] extraEmail = intent.getStringArrayExtra(Intent.EXTRA_EMAIL);
|
||||||
|
String[] extraBcc = intent.getStringArrayExtra(Intent.EXTRA_BCC);
|
||||||
|
String[] extraCc = intent.getStringArrayExtra(Intent.EXTRA_CC);
|
||||||
|
|
||||||
|
String addressList = new String();
|
||||||
|
// Cache array size, as per Google's recommendations.
|
||||||
|
int arraySize;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
mSubjectView.setText(extraSubject);
|
||||||
|
mMessageContentView.setText(extraText);
|
||||||
|
|
||||||
|
if (extraEmail != null){
|
||||||
|
arraySize = extraEmail.length;
|
||||||
|
if (arraySize > 1){
|
||||||
|
for (i=0; i < (arraySize-1); i++) {
|
||||||
|
addressList += extraEmail[i]+", ";
|
||||||
}
|
}
|
||||||
else {
|
addressList += extraEmail[arraySize-1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mToView.setText(addressList);
|
||||||
|
addressList = "";
|
||||||
|
|
||||||
|
if (extraBcc != null){
|
||||||
|
arraySize = extraBcc.length;
|
||||||
|
if (arraySize > 1){
|
||||||
|
for (i=0; i < (arraySize-1); i++) {
|
||||||
|
addressList += extraBcc[i]+", ";
|
||||||
|
}
|
||||||
|
addressList += extraBcc[arraySize-1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mBccView.setText(addressList);
|
||||||
|
addressList = "";
|
||||||
|
|
||||||
|
if (extraCc != null){
|
||||||
|
arraySize = extraCc.length;
|
||||||
|
if (arraySize > 1){
|
||||||
|
for (i=0; i < (arraySize-1); i++) {
|
||||||
|
addressList += extraCc[i]+", ";
|
||||||
|
}
|
||||||
|
addressList += extraCc[arraySize-1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mCcView.setText(addressList);
|
||||||
|
addressList = "";
|
||||||
|
|
||||||
|
} else {
|
||||||
mAccount = (Account) intent.getSerializableExtra(EXTRA_ACCOUNT);
|
mAccount = (Account) intent.getSerializableExtra(EXTRA_ACCOUNT);
|
||||||
mFolder = (String) intent.getStringExtra(EXTRA_FOLDER);
|
mFolder = (String) intent.getStringExtra(EXTRA_FOLDER);
|
||||||
mSourceMessageUid = (String) intent.getStringExtra(EXTRA_MESSAGE);
|
mSourceMessageUid = (String) intent.getStringExtra(EXTRA_MESSAGE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user