No matter how I try I’m unable to get my android device to open it’s default email app when triggering the
native.showPopup (“mail”). The below code works fine on IOS though.
Code I use is:
local options ={
to = { “x@xx.com”},
subject = “xx”,
body = “xxxx”,
attachment ={
{ baseDir=system.DocumentsDirectory, filename=“file1.db”, type=“text” },
{ baseDir=system.DocumentsDirectory, filename=“file2.db”, type=“text” }
},
}
local result = native.showPopup(“mail”, options)
if not result then
native.showAlert( “Oops!”,“The default email app is not supported/setup on this device.”, { “OK” })
end
All i end up getting is the error codes below:
12-02 22:15:36.554: W/Bundle(28763): Key android.intent.extra.TEXT expected ArrayList<CharSequence> but value was a java.lang.String. The default value <null> was returned.
12-02 22:15:36.554: W/Bundle(28763): Attempt to cast generated internal exception:
12-02 22:15:36.554: W/Bundle(28763): java.lang.ClassCastException: java.lang.String cannot be cast to java.util.ArrayList
12-02 22:15:36.554: W/Bundle(28763): at android.os.Bundle.getCharSequenceArrayList(Bundle.java:1367)
12-02 22:15:36.554: W/Bundle(28763): at android.content.Intent.getCharSequenceArrayListExtra(Intent.java:5333)
12-02 22:15:36.554: W/Bundle(28763): at android.content.Intent.migrateExtraStreamToClipData(Intent.java:7901)
12-02 22:15:36.554: W/Bundle(28763): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1423)
12-02 22:15:36.554: W/Bundle(28763): at android.app.Activity.startActivityForResult(Activity.java:3582)
12-02 22:15:36.554: W/Bundle(28763): at android.app.Activity.startActivityForResult(Activity.java:3543)
12-02 22:15:36.554: W/Bundle(28763): at com.ansca.corona.CoronaActivity.showSendMailWindowUsing(CoronaActivity.java:1841)
12-02 22:15:36.554: W/Bundle(28763): at com.ansca.corona.CoronaShowApiHandler.showSendMailWindowUsing(CoronaShowApiHandler.java:52)
12-02 22:15:36.554: W/Bundle(28763): at com.ansca.corona.Controller$9.run(Controller.java:1011)
12-02 22:15:36.554: W/Bundle(28763): at android.os.Handler.handleCallback(Handler.java:733)
12-02 22:15:36.554: W/Bundle(28763): at android.os.Handler.dispatchMessage(Handler.java:95)
12-02 22:15:36.554: W/Bundle(28763): at android.os.Looper.loop(Looper.java:146)
12-02 22:15:36.554: W/Bundle(28763): at android.app.ActivityThread.main(ActivityThread.java:5653)
12-02 22:15:36.554: W/Bundle(28763): at java.lang.reflect.Method.invokeNative(Native Method)
12-02 22:15:36.554: W/Bundle(28763): at java.lang.reflect.Method.invoke(Method.java:515)
12-02 22:15:36.554: W/Bundle(28763): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
12-02 22:15:36.554: W/Bundle(28763): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
12-02 22:15:36.554: W/Bundle(28763): at dalvik.system.NativeStart.main(Native Method)
12-02 22:15:36.559: V/ApplicationPolicy(2839): isApplicationStateBlocked userId 0 pkgname com.sec.android.sidesync30