Android Tutorial Splash screen

This is the code:
B4X:
'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.
   Dim Timer1 As Timer
   
End Sub

Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("layoutmain")
   Panel1.Visible=True
   Timer1.Initialize("Timer1", 3000)
   Timer1.Enabled=True
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub Timer1_tick
Panel1.Enabled=False
Panel1.Visible=False
Timer1.Enabled = False
End Sub

In Layout, of course, I have the component Panel 1. But, when I try to complile:
Compiling code. Error
Error parsing program.
Error description: Undeclared variable 'panel1' is used before it was assigned any value.
Occurred on line: 17
Panel1.Visible=True

Any idea, please??
 

Gary Miyakawa

Active Member
Licensed User
Longtime User
Watch out for Case (Panel1 vs panel1) and spaces (Panel1 vs Panel 1)...

I've been bitten by both.... (and old eyes)...

GaryM
 

barx

Well-Known Member
Licensed User
Longtime User
You need

Dim Panel1 as Panel

In the sub globals.
Views need to be declared before you can do anything with them.

Sent from my Desire Z
 
Top