I apologize in advance if this has been asked before, but I absolutely 
cannot find a solution.  I have a simple Android app (using HTML/Javascript 
and phonegap) which offers an email option that sends data from the app via 
mailto (with parameters) and window.open.  This worked fine until my users 
started updating to 4.0.  

var mailto_link = 'mailto:?subject=' + subject + '&body=' + body_message;
win = window.open(mailto_link, 'emailWindow');

Now that Android no longer supports this, I need to use webintents to send 
the email.  The current code using Phonegap 1.1.0 and webintents does not 
work for me.  I have tried several different versions of phonegap/cordova 
including cordova 2.1.0.  I have followed examples by Boris Smus... 

var extras = {};
  extras[WebIntent.EXTRA_SUBJECT] = subject;
  extras[WebIntent.EXTRA_TEXT] = body_message;
  extras[WebIntent.EXTRA_EMAIL] = 'some...@comcast.net';
  window.plugins.webintent.startActivity({
      action: WebIntent.ACTION_SEND,
      type: 'text/plain',
      extras: extras
    },
    function() {},
    function() {
      alert('Failed to send email via Android Intent');
    }
  );

 The new code keeps throwing the error "Failed to send email via Android 
Intent".  I have made sure my files are importing webintent.js as well as 
phonegap/cordova.js

I need to get this working, so my question is - How can I get the details 
on what is actually causing the error?
Also, I feel that my AndroidManifest.xml may be causing the issue so here 
is a portion of my file where my intent filters are defined...

    <application android:icon="@drawable/icon" 
android:label="@string/app_name" >
        <activity android:name="com.android.SCAT2.SCAT2"
                  android:label="@string/app_name"
                  android:configChanges="orientation|keyboardHidden" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />       
         
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
            <action android:name="android.intent.action.SEND" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="text/plain" />
            </intent-filter>
        </activity>
    </application>

Any help is greatly appreciated and if I need to provide any additional 
details, please let me know.  Thanks in advance!


-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to