OK thank you Erel, I have changed it to that and it now compiles and runs, but I have a new problem now.
The minute I load the form (view) where I have my map fragment on, my app crashes.
It says I do not have something required in my manifest.
To try to help you solve this problem, here is my Project Attributes Region:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#AdditionalJar: com.google.android.gms
lay-services-maps
#End Region
Here is my manifest:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information:
https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)
AddApplicationText(
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyB_myZDlKkZBFVB-yxEbUI2YJNn9HIeGAc"/>
)
'End of default text.
Here is my Sub Globals:
Sub Globals
Private gmap As GoogleMap
Private MapFragment1 As MapFragment
End Sub
Sub MapFragment1_Ready
gmap = MapFragment1.GetMap
Dim m1 As Marker = gmap.AddMarker(10, 30, "test")
m1.Snippet = "This is the snippet"
End Sub