I am a newbie to developing in phonegap so I am sorry if this is a obvious answer. This is the last part of my project the only part of it that isnt functioning is the plugin.
I get the message "Failed to send email via Android Intent" and get the following error in logcat "Error: Status=2 Message=Class not found at file:///android_asset/www/phonegap-1.4.1.js:651"
I cannot figure this out, I have been at it for the past day!
I have added the plugin to the plugin.xml
plugin name="webintent" value="com.borismus.webintent.WebIntent"
I have the correct name space for the WebIntent.java file.
package borismus.webintent;
And I have the webintent.js file referenced in my index.html.
Below is the function which uses the plugin. function emailxmlfile(){
var subject = "Sports Code Xml Edit List" + filedate.toDateString();
var body = "";
if(!window.plugins || !window.plugins.webintent){
alert('Unable to find webintent plugin');
}else{
var extras={};
extras[WebIntent.EXTRA_SUBJECT] = subject;
extras[WebIntent.EXTRA_TEXT] = body;
window.plugins.webintent.startActivity({
action: WebIntent.ACTION_SEND,
type: 'text/plain',
extras: extras
}, function() {}, function(e) {alert('Failed to send email via Android Intent');});
}};
Any Help would be greatly appreciated. Thanks
I know I might be late, but got your same code working without a minor and subtle change: respect capitalization when adding the plugin details to the .xml file. I mean, you stated this:
plugin name="webintent" value="com.borismus.webintent.WebIntent"
BUT should read this instead (watch out for the name!):
plugin name="WebIntent" value="com.borismus.webintent.WebIntent"
the red squiggle in Eclipse goes away once you correct the typo, and the code just works fine so I can invoke the email app from mine.
HTH!
Usally when you get that message, its that you have missed to add the plugin to plugins.xml
<plugin name="WebIntent" value="com.borismus.webintent.WebIntent"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With