katzer / cordova-plugin-email-composer

Edit and send email messages
Apache License 2.0
344 stars 334 forks source link

adding a body causes "attempt to cast generated internal exception" #34

Closed davidpesce closed 10 years ago

davidpesce commented 10 years ago

The following occurs whenever I add a body to my email

04-24 19:52:24.489: W/Bundle(10264): Key android.intent.extra.TEXT expected ArrayList<CharSequence> but value was a java.lang.String.  The default value <null> was returned.
04-24 19:52:24.489: W/Bundle(10264): Attempt to cast generated internal exception:
04-24 19:52:24.489: W/Bundle(10264): java.lang.ClassCastException: java.lang.String cannot be cast to java.util.ArrayList
04-24 19:52:24.489: W/Bundle(10264):    at android.os.Bundle.getCharSequenceArrayList(Bundle.java:1367)
04-24 19:52:24.489: W/Bundle(10264):    at android.content.Intent.getCharSequenceArrayListExtra(Intent.java:4736)
04-24 19:52:24.489: W/Bundle(10264):    at android.content.Intent.migrateExtraStreamToClipData(Intent.java:7252)
04-24 19:52:24.489: W/Bundle(10264):    at android.content.Intent.migrateExtraStreamToClipData(Intent.java:7219)
04-24 19:52:24.489: W/Bundle(10264):    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1417)
04-24 19:52:24.489: W/Bundle(10264):    at android.app.Activity.startActivityForResult(Activity.java:3424)
04-24 19:52:24.489: W/Bundle(10264):    at android.app.Activity.startActivityForResult(Activity.java:3385)
04-24 19:52:24.489: W/Bundle(10264):    at org.apache.cordova.CordovaActivity.startActivityForResult(CordovaActivity.java:859)
04-24 19:52:24.489: W/Bundle(10264):    at de.appplant.cordova.plugin.emailcomposer.EmailComposer$1.run(EmailComposer.java:124)
04-24 19:52:24.489: W/Bundle(10264):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
04-24 19:52:24.489: W/Bundle(10264):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
04-24 19:52:24.489: W/Bundle(10264):    at java.lang.Thread.run(Thread.java:841)
mr-pascal commented 10 years ago

This error is no problem, it's catched and thrown from the Android code itself: public ArrayList getCharSequenceArrayList(String key) { unparcel(); Object o = mMap.get(key); if (o == null) { return null; } try { return (ArrayList) o; } catch (ClassCastException e) { typeWarning(key, o, "ArrayList", e); <----- this one here return null; } }

As long as it works (and in my case it does) you can just ignore it ;)

katzer commented 10 years ago

I know about the error, but thats an android problem. If I use ArrayList then it will not work even without any errors. but if I use String it works even with that error.