Android Question .

Working on the guidelines above i wanted my splash screen to appear for 3 seconds then show the main application screen.
So I created 2 layouts: "splashpanel.bal" for the splash screen and "somelayout.bal" for the application (for testing, just a single button that displays a msgbox)

==================================
tmr as timer declared in Process_Globals


------------------------------------
Sub Activity_Create(FirstTime As Boolean)
If firsttime Then Splash_Show

activity.LoadLayout("somelayout")
End Sub

Sub splash_show
activity.LoadLayout("splashpanel")
tmr.Initialize("tmr",3000)
tmr.Enabled=True
....adjusting the panel size & position
End Sub

Sub tmr_Tick
splpan.Enabled = False
splpan.Visible = False
tmr.Enabled = False
End Sub

=============================

This showed the splash for 3 second BUT ALSO the button (from "somelayout"). After 3 secs only the button remain on screen. So I tried to "delay" loading the main layout by this:

=========================
Sub Activity_Create(FirstTime As Boolean)
If firsttime Then Splash_Show
Do While tmr.Enabled
DoEvents
Loop
activity.LoadLayout("somelayout")
End Sub

=========================

BUT the splashscreen NEVER vanished (the tmr_tick never 'fired') and the button never appeared!!!! Help anyone?
 
Upvote 0
ok. here we go again....

Working on the guidelines above i wanted my splash screen to appear for 3 seconds then show the main application screen.
So I created 2 layouts: "splashpanel.bal" for the splash screen and "somelayout.bal" for the application (for testing, just a single button that displays a msgbox)

==================================
tmr as timer declared in Process_Globals


------------------------------------
Code: Copy
Sub Activity_Create(FirstTime As Boolean)
If firsttime Then Splash_Show

activity.LoadLayout("somelayout")
End Sub

Sub splash_show
activity.LoadLayout("splashpanel")
tmr.Initialize("tmr",3000)
tmr.Enabled=True
....adjusting the panel size & position
End Sub

Sub tmr_Tick
splpan.Enabled = False
splpan.Visible = False
tmr.Enabled = False
End Sub
=============================

This showed the splash for 3 second BUT ALSO the button (from "somelayout"). After 3 secs only the button remain on screen. So I tried to "delay" loading the main layout by this:

=========================
Code: Copy
Sub Activity_Create(FirstTime As Boolean)
If firsttime Then Splash_Show
Do While tmr.Enabled
DoEvents
Loop
activity.LoadLayout("somelayout")
End Sub
=========================

BUT the splashscreen NEVER vanished (the tmr_tick never 'fired') and the button never appeared!!!! Help anyone?
 
Upvote 0
Erel, you are right. But i intend to "isolate" the splash screen as much as possible from the main activity (so i can use it in other apps) and loading the main app's layout in the timer tick of the splash screen defies this purpose.
 
Upvote 0
Erel is correct, the way you have defined your 'If' statement causes the splash to be loaded and then immediately the "activity.LoadLayout("somelayout")" as it is the next statement in sequence putting one on top of the other. If you used an If Else this would get over this, but you would still have to put the "activity.LoadLayout("somelayout")" in the Timer_tick routine as well.
Code: Copy
Sub Activity_Create(FirstTime As Boolean)
If firsttime Then 
      Splash_Show
Else
      activity.LoadLayout("somelayout")
End Sub
This way the you have both options covered;
1) On first load you will get your splash screen then 3 sec later timer1 will fire this routine will close the splash screen, disable the timer1 and load the main layout.
2)If it is not 'firsttime' then we do not want the splash screen and the 'Else' will cause the main layout to be loaded.
Edward
 
Upvote 0
Easy Clean Way to Pause Code

Hello All,

Here is a very easy and clean way to pause the code for the splash screen and you do not have to use any timers! Copy this code in as a sub, where you want a pause just enter:

Example: Pause(3)

Just put the number of seconds you want to pause in the () as an INT. ;)

Thanks,

Margret

Code: Copy
Sub Pause(Tvar As Int)
   Dim Tstart As Long
   Tstart = DateTime.Now
   Do While DateTime.Now-Tstart < (Tvar*1000)
   Loop
End Sub
 
Upvote 0
It's not the emulator's problem, it's MY problem!!!
the main activity shd be changed to:

Code: Copy
Sub Activity_Create(FirstTime As Boolean)
If FirstTime OR Not(Done) Then  <==== the change
  Splash_Show
Else
  activity.LoadLayout("somelayout")
End If
End Sub
 
Upvote 0
Margret,

I don't know the internals of B4A/Java/Android (Erel should be THE source for the answer) but as a seasoned programmer i think that would just tie up the processor, perhaps preventing it from other tasks.
 
Upvote 0
Hi boten,
I would do it that way:
With two panels added by code, but each panel has its own layout file.
Code: Copy
[SIZE=2][FONT=Courier New][COLOR=#0000ff][SIZE=2][FONT=Courier New][COLOR=#0000ff][SIZE=2][FONT=Courier New][COLOR=#0000ff]Sub [/COLOR][/FONT][/SIZE][/COLOR][/FONT][/SIZE][/COLOR][/FONT][/SIZE][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]Process_Globals[/SIZE][/FONT]
[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]  Dim[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] Timer1 [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008b8b][FONT=Courier New][SIZE=2][COLOR=#008b8b][FONT=Courier New][SIZE=2][COLOR=#008b8b]Timer[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]End Sub[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
 
[FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Sub [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]Globals[/SIZE][/FONT]
[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]  Dim[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] pnlMain, pnlSplash [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008b8b][FONT=Courier New][SIZE=2][COLOR=#008b8b][FONT=Courier New][SIZE=2][COLOR=#008b8b]Panel[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]End Sub[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
 
[FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Sub [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]Activity_Create(FirstTime [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008b8b][FONT=Courier New][SIZE=2][COLOR=#008b8b][FONT=Courier New][SIZE=2][COLOR=#008b8b]Boolean[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]  pnlMain.Initialize([/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]""[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]  Activity.AddView(pnlMain, [/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2], [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2], [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]100%x[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2], [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]100%y[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]  pnlMain.Visible = [/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]False[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]  If[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] FirstTime [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]    pnlSplash.Initialize([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]""[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]    Activity.AddView(pnlSplash, [/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2], [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2], [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]100%x[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2], [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]100%y[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]    Timer1.Initialize([/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"Timer1"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]3000[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]    pnlSplash.LoadLayout([/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"Splash"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]    Timer1.Enabled = [/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]True[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]    pnlMain.LoadLayout([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"Main"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]  Else[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]    pnlMain.LoadLayout([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"Main"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]    pnlMain.Visible = [/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]True[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]  End [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][/FONT]
[SIZE=2][FONT=Courier New][COLOR=#0000ff]End Sub[/COLOR][/FONT][/SIZE]
 
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Sub [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]Timer1_Tick[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]  pnlSplash.Visible = [/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]False[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]  pnlMain.Visible = [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]True[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]  Timer1.Enabled = [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]False[/COLOR][/SIZE][/FONT]
[SIZE=2][FONT=Courier New][COLOR=#0000ff]End Sub[/COLOR][/FONT][/SIZE][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
Attached the small test program.

Best regards.
 

Attachments

Upvote 0
Hi Klaus,

tried your pgm. When main activity is finally shown, and the user wants to quit and press the back btn, the app is still in memory (until kicked out by the system) so if you start the program again, the splash doesn't show.

I want to show the splash whenever the user starts it (after he previously exited) but not show the splash if the user just switched to another app (e.g pressed home) but did NOT intend to quit. (just like selecting another open app from the task bar in windows), for this purpose i had to use the 'Done' semaphore.

I just realized my long post from this morning July,25 was somehow drifted into a limbo. I'll post what i've done, and is working soon.
 
Last edited:
Upvote 0
here is what's working:

Code: Copy
Sub Process_Globals
Dim Done As Boolean   ' semaphore to signal if splash shown already
Done=False
End Sub

the structure of the pgm is:
Code: Copy
Sub Activity_Create(FirstTime As Boolean)
If FirstTime OR Not(Done) Then
  Splash_Show
Else
  activity.LoadLayout("somelayout")
End If
End Sub

Sub Activity_Resume
End Sub

Sub Activity_Pause (UserClosed As Boolean)
tmr.Enabled=False  ' if splash itself is interrupted (e.g. orientaion) then stop it
Done=True
If UserClosed Then 
  Done=False
End If  
End Sub

Sub button1_click
 Msgbox("clicked","the real app")
End Sub

Sub Splash_Show
 If Done Then Return  ' might be redundant, just to be sure & safe
   activity.LoadLayout("splashpanel")
   ... adjust the panel
   tmr.Initialize("tmr",3000)
   tmr.Enabled=True
End Sub

Sub tmr_Tick
  splpan.Enabled=False
  splpan.Visible=False
  tmr.Enabled=False
  Done=True
  activity.LoadLayout("somelayout")
End Sub

The 'Done' semaphore will be true if timer tick fired, or if the app is paused. In the case of the app being
paused we want to "abandon" any hope of redisplaying the splash (as in the case of change orientation in the
middle of the splash).
When the user press back, that is wants to quit the app, Done is changed back to false in order to show it again on the
next program start, but if the pasue was due to other cause (orientation, home scrren, phone rings...) then we don't show the splash.

the statement: If FirstTime OR Not(Done) Then
takes care of this situation.

Hope this is clear enough
 
Upvote 0
I cannot remove the splash screen!

HI! Following this examples, my splash screen works but when the mainpanel opens, the splash screen remains as background!

how can I remove it???

cirollo
 
Upvote 0
Hi cirollo,

I hope this will solve your problem:

On the main module:

Code: Copy
Sub Globals
   Dim Timer1       As Timer
   Dim edtInfo    As EditText    'in case you want an info/announcement as a "splash"display
   Dim Panel1, Panel2 As Panel      'the panel1 to display the info/announcement, panel2 for the main panel
End Sub

Code: Copy
Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("main.bal")
   Panel1.Visible=True
   Timer1.Initialize("Timer1", 1000)   '1000= for 1 second "splash" panel is visible
   Timer1.Enabled=True
   Panel2.Visible=False
End Sub

Code: Copy
Sub Timer1_tick
   Panel1.Visible =False                'after 1 second, "splash"display panel will be gone
   Timer1.Enabled = False
   Panel2.Enabled = True
   Panel2.Visible = True
End Sub

Well, that's about it.
 
Last edited:
Upvote 0
Back
Top