i open the email app with this code.
I think, the first time I get a dialog to choose the app.
I selected the notes app.
Now it always open the notes app.
First, how can I prefend this dialog . It should open always gmail.
Second how can I change back via script , without deinstall .
B4X:
Dim msg As Email
subject=en.desc_plaintext & " - " & en.Title
msg.Subject=subject
msg.Body= gl_BODY
msg.To.Add(gl_EMAIL)
StartActivity(msg.GetIntent)
Now it always open the notes app.
First, how can I prefend this dialog . It should open always gmail.
Second how can I change back via script , without deinstall .
I know this, but the users are no programmers, maybe old people. When they quickly choose the wrong app ....
So is there no way to say open gmail ...., nothing else ?
one option is like the code, but it always open the dialog to choose
B4X:
Dim msg As Email
subject=en.desc_plaintext & " - " & en.Title
msg.Subject=subject
msg.Body= gl_BODY
msg.To.Add(gl_EMAIL)
Dim i As Intent
i = msg.GetIntent
i.SetComponent("android/com.android.internal.app.ResolverActivity")
StartActivity(i)
Dim msg As Email
Dim intent1 As Intent
msg.Subject="subject"
msg.Body= "body"
msg.To.Add("youremail@gmail.com")
intent1 = msg.GetIntent
intent1.SetComponent("com.google.android.gm/.ComposeActivityGmail")
StartActivity(intent1)
choose from here
B4X:
Dim pm As PackageManager
For Each em As String In pm.QueryIntentActivities(msg.getintent)
Log(em)
Next
Dim msg As Email
Dim intent1 As Intent
msg.Subject="subject"
msg.Body= "body"
msg.To.Add("youremail@gmail.com")
intent1 = msg.GetIntent
intent1.SetComponent("com.google.android.gm/.ComposeActivityGmail")
StartActivity(intent1)
choose from here
B4X:
Dim pm As PackageManager
For Each em As String In pm.QueryIntentActivities(msg.getintent)
Log(em)
Next
This give an error :
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.SEND_MULTIPLE typ=text/plain flg=0x20000 cmp=com.google.android.gm/.ComposeActivityGmail (has extras) } from ProcessRecord{eac19be 24238:jk.rt_calendar/u0a202} (pid=24238, uid=10202) not exported from uid 10092