mirror of
https://github.com/gsantner/dandelion
synced 2024-11-10 14:36:01 +01:00
Share Activity (only text)
This commit is contained in:
parent
7efcada64a
commit
7f2eda535b
1 changed files with 2 additions and 5 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue