made it possible to share text files
This commit is contained in:
parent
48be5af55f
commit
b17ca3543f
|
@ -181,23 +181,24 @@ public class ShareWithActivity extends XmppActivity implements XmppConnectionSer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final String type = intent.getType();
|
final String type = intent.getType();
|
||||||
Log.d(Config.LOGTAG, "action: "+intent.getAction()+ ", type:"+type);
|
final String action = intent.getAction();
|
||||||
|
Log.d(Config.LOGTAG, "action: "+action+ ", type:"+type);
|
||||||
share.uuid = intent.getStringExtra("uuid");
|
share.uuid = intent.getStringExtra("uuid");
|
||||||
if (Intent.ACTION_SEND.equals(intent.getAction())) {
|
if (Intent.ACTION_SEND.equals(action)) {
|
||||||
final Uri uri = getIntent().getParcelableExtra(Intent.EXTRA_STREAM);
|
final String text = intent.getStringExtra(Intent.EXTRA_TEXT);
|
||||||
if (type != null && uri != null && !type.equalsIgnoreCase("text/plain")) {
|
final Uri uri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
|
||||||
|
if (type != null && uri != null && text == null) {
|
||||||
this.share.uris.clear();
|
this.share.uris.clear();
|
||||||
this.share.uris.add(uri);
|
this.share.uris.add(uri);
|
||||||
this.share.image = type.startsWith("image/") || isImage(uri);
|
this.share.image = type.startsWith("image/") || isImage(uri);
|
||||||
} else {
|
} else {
|
||||||
this.share.text = getIntent().getStringExtra(Intent.EXTRA_TEXT);
|
this.share.text = text;
|
||||||
}
|
}
|
||||||
} else if (Intent.ACTION_SEND_MULTIPLE.equals(intent.getAction())) {
|
} else if (Intent.ACTION_SEND_MULTIPLE.equals(action)) {
|
||||||
this.share.image = type != null && type.startsWith("image/");
|
this.share.image = type != null && type.startsWith("image/");
|
||||||
if (!this.share.image) {
|
if (!this.share.image) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.share.uris = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
|
this.share.uris = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
|
||||||
}
|
}
|
||||||
if (xmppConnectionServiceBound) {
|
if (xmppConnectionServiceBound) {
|
||||||
|
|
Loading…
Reference in a new issue