Hi Everyone,
Can you tell me why the AddView statement is making my app display an error that says "Unfortunately, ... has stopped.
There is no other message indicating why.
panelMain is a panel view that I added using the designer.
The EditText is displayed and also something unexpected shows up in the EditText. Instead of saying "Hello" it says "True". Not sure why that happens as well. Looks like it is being forced to be a boolean.
Can you tell me why the AddView statement is making my app display an error that says "Unfortunately, ... has stopped.
There is no other message indicating why.
B4X:
#Region Module Attributes
#FullScreen: False
#IncludeTitle: True
#ApplicationLabel: My Sound Settings
#VersionCode: 1
#VersionName:
#SupportedOrientations: Portrait
#CanInstallToExternalStorage: False
#End Region
'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
Dim swMasterVolume As SwitchView
Dim panelMain As Panel
Dim etMyText As EditText
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
etMyText.Initialize("TextBox")
etMyText.Text = "Hello"
panelMain.AddView(etMyText, 0dip, 0dip, 100dip, 50dip)
swMasterVolume.Initialize(Me, "swMasterVolume")
'panelMain.AddView(swMasterVolume.Switch, 10dip, 100dip, 200dip, 50dip)
If StateManager.RestoreState(Activity, "Main", 60) = False Then
EndIf
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
StateManager.SaveState(Activity, "Main")
StateManager.SaveSettings
End Sub
Sub Button1_Click
Activity.Finish
End Sub
panelMain is a panel view that I added using the designer.
The EditText is displayed and also something unexpected shows up in the EditText. Instead of saying "Hello" it says "True". Not sure why that happens as well. Looks like it is being forced to be a boolean.
Last edited: