German Fenster wechseln

tudorf

Active Member
Licensed User
Longtime User
Hallo
Ich wechsel noch dem drücken auf einen Button das Haupt-Fenster in ein Unter-Fenster und möchte durch drücken des "Back-Butten" wieder das alte Haupt-Fenster anzeigen. Dieses bleibt aber schwarz. Die Datei habe ich mal angehängt.

Die Dokumentation B4A-Tutorial-Deutsch, BeginnersGuide, UsersGuide, B4A-Helpviewer sowie das Forum habe ich durchsucht, kann aber nicht erkenne woran es liegt.

MfG Tudorf
 

tudorf

Active Member
Licensed User
Longtime User
Leider kann ich wohl keine Datei anhängen.

Modul Main


'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub

Sub Globals
End Sub

Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub RemoveViews
Dim i As Int
For i=Activity.NumberOfViews-1 To 0 Step -1
Activity.RemoveViewAt(i)
Next
End Sub

Sub Button2_Click
RemoveViews
StartActivity("Bild2")
End Sub

Sub Button1_Click
RemoveViews
StartActivity("Bild3")
End Sub

Sub ButtonHaupt_Click
'RemoveViews
'StartActivity("Main")
End Sub

Modul Bild2

'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim GPS1 As GPS
End Sub

Sub Globals
Dim lblLon As Label
Dim lblLat As Label
Dim lbldis As Label
Dim lblgrad As Label
Dim lblSpeed As Label
Dim lblSatellites As Label

End Sub

Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
GPS1.Initialize("GPS")
End If
Activity.LoadLayout("Bild2")
End Sub

Sub Activity_Resume
If GPS1.GPSEnabled = False Then
ToastMessageShow("Bitte GPS einschalten.", True)
StartActivity(GPS1.LocationSettingsIntent) 'Will open the relevant settings screen.
Else
GPS1.Start(0, 0) 'Listen to GPS with no filters.
End If
End Sub

Sub Activity_Pause (UserClosed As Boolean)
GPS1.Stop
ToastMessageShow("Bitte GPS ausschalten.", True)
StartActivity(GPS1.LocationSettingsIntent) 'Will open the relevant settings screen.
End Sub

Sub GPS_LocationChanged (Location1 As Location)
lblLat.Text = "Lat = " & Location1.ConvertToMinutes(Location1.Latitude)
lblLon.Text = "Lon = " & Location1.ConvertToMinutes(Location1.Longitude)
lblSpeed.Text = "Speed = " & Location1.Speed
Dim Location2 As Location
'Location2.Initialize2("51:37.296", "8:41.626")
Location2.Initialize2("51:38.130", "8:40.004")
lbldis.Text = "Distance = " & Location1.DistanceTo(Location2)
lblgrad.Text = "Grad = " & Location1.BearingTo (Location2)

End Sub

Sub GPS_UserEnabled (Enabled As Boolean)
ToastMessageShow("GPS device enabled = " & Enabled, True)
End Sub

Sub GPS_GpsStatus (Satellites As List)
lblSatellites.Text = "Satellites:" & CRLF
For i = 0 To Satellites.Size - 1
Dim Satellite As GPSSatellite
Satellite = Satellites.Get(i)
lblSatellites.Text = lblSatellites.Text & CRLF & Satellite.Prn & _
" " & Satellite.Snr & " " & Satellite.UsedInFix & " " & Satellite.Azimuth _
& " " & Satellite.Elevation
Next
End Sub

Sub ButtonHaupt_Click
'RemoveViews
'StartActivity("Main")
End Sub


Sub RemoveViews
Dim i As Int
For i=Activity.NumberOfViews-1 To 0 Step -1
Activity.RemoveViewAt(i)
Next
End Sub

Modul Bild3

'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.

End Sub

Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Bild3")
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub


Sub ButtonHaupt_Click
'RemoveViews
'StartActivity("Main")
End Sub


Sub RemoveViews
Dim i As Int
For i=Activity.NumberOfViews-1 To 0 Step -1
Activity.RemoveViewAt(i)
Next
End Sub
 

tudorf

Active Member
Licensed User
Longtime User
Bei meinen ersten Versuchen musste ich es einbinden. Nun klappts.
Danke
 
Top