Added the possibility to share an image and html encoded text

This commit is contained in:
raananw
2012-01-26 12:22:40 +01:00
parent 4d926fa893
commit 7e4623f188

View File

@@ -122,7 +122,17 @@ public class WebIntent extends Plugin {
}
for (String key : extras.keySet()) {
String value = extras.get(key);
i.putExtra(key, value);
//If type is text html, the extra text must sent as HTML
if (key.equals(Intent.EXTRA_TEXT) && type.equals("text/html")) {
i.putExtra(key, Html.fromHtml(value));
} else if(key.equals(Intent.EXTRA_STREAM)) {
//allowes sharing of images as attachments.
//value in this case should be a URI of a file
i.putExtra(key, Uri.parse(value));
}
else {
i.putExtra(key, value);
}
}
this.ctx.startActivity(i);
}