1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2024-11-25 22:02:08 +01:00

Share Activity (only text)

This commit is contained in:
scoute-dich 2016-04-14 22:01:54 +02:00
parent 7efcada64a
commit 7f2eda535b

View file

@ -208,14 +208,10 @@ public class ShareActivity extends MainActivity {
Intent intent = getIntent(); Intent intent = getIntent();
String action = intent.getAction(); String action = intent.getAction();
String type = intent.getType(); String type = intent.getType();
String sharedSubject = intent.getStringExtra(Intent.EXTRA_SUBJECT);
if (Intent.ACTION_SEND.equals(action) && type != null) { if (Intent.ACTION_SEND.equals(action) && type != null) {
if ("text/plain".equals(type)) { if ("text/plain".equals(type)) {
handleSendText(intent); // Handle text being sent handleSendText(intent); // Handle text being sent TODO difference of "text/plain" intents with and without EXTRA_SUBJECT
} else if (sharedSubject != null) {
// TODO difference of ALL intents with and without EXTRA_SUBJECT
handleSendSubject(intent); // Handle intent with extra_subject being sent
} else if (type.startsWith("image/")) { } else if (type.startsWith("image/")) {
// TODO Handle single image being sent // TODO Handle single image being sent
handleSendImage(intent); handleSendImage(intent);
@ -252,6 +248,7 @@ public class ShareActivity extends MainActivity {
} }
} }
// TODO difference of "text/plain" intents with and without EXTRA_SUBJECT
void handleSendSubject(Intent intent) { void handleSendSubject(Intent intent) {
final String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT); final String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT);
final String sharedSubject = intent.getStringExtra(Intent.EXTRA_SUBJECT); final String sharedSubject = intent.getStringExtra(Intent.EXTRA_SUBJECT);