Noob here again - Webview

canalrun

Well-Known Member
Licensed User
Longtime User
Hello,
For an About page in my app, I am using a Webview and an HTML file added to my project.

My HTML file is very simple and straightforward, but it has one Mailto link and one HTTP link to a page on my Internet site.

The HTTP link works properly, but the Mailto link opens a page saying:

webpage not available
the webpage at mailto: [email protected]?Subject= myapp%20 might be temporarily down or it may have moved permanently to a new address.

The same file works properly, as expected, in Firefox.

The code I use to open my webpage is borrowed from this forum :eek:

str = File.GetText(File.DirAssets, "myapp.html")
WebView1.LoadHtml(str)

Is a Mailto link allowed in the Webview?

Thanks,
Barry.
 

pluton

Active Member
Licensed User
Longtime User
Why don't you add Mail To when user press menu button

It goes something like this:
B4X:
Sub Activity_Create(FirstTime As Boolean)
activity.AddMenuItem2("Mail Author","mailme",LoadBitmap(File.DirAssets,"mail.png"))
' here goes more code so i just deleted
End Sub
' And then just put this:
Sub mailme_click
   Dim mailapp As Email
   mailapp.To.Add("[email protected]")
   mailapp.Subject = "From my app"
   StartActivity(mailapp.GetIntent)

End Sub

With this code the user will open to choose what mail client he want to use (email, gmail...) and then he just need to type something and send a mail to you :)
 
Upvote 0
Top