Would this be possible? Maybe using the reflection library?
It would be useful as the only requirement I have for the phone library in my app is to open the browser, which works fine but adds the "READ PHONE STATE AND IDENTITY" permissions which can be off-putting for users.
Here's my code:
B4X:
Sub Webview1_OverrideUrl (Url As String) As Boolean
Dim p As PhoneIntents
Dim intResponse As Int
intResponse = Msgbox2("View item?", "View item","Go to Site","Maybe later!","",Null)
If intResponse = DialogResponse.POSITIVE Then
StartActivity(p.OpenBrowser(Url))
End If
Return True
End Sub
Dim objIcon As Bitmap
Dim strFilename As String
strFilename = "ic_menu_mapmode.png"
Dim objIn As InputStream
If File.Exists(File.DirAssets,strFilename) = True Then
objIn = File.OpenInput(File.DirAssets, strFilename)
objIcon.Initialize2(objIn)
Activity.AddMenuItem2("Select your region", "mnuHelp", objIcon )
End If
Where ic_menu_mapmode.png has already been added to your project. These resources are good: