mirror of
https://github.com/purplecabbage/phonegap-plugins.git
synced 2026-04-24 03:00:11 -04:00
Added the possibility to share an image and html encoded text
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user