Domanda

I just started programming in Basic4android. I have created 2 layouts. splash and search. I want to display the splash layout for about 2 seconds and then automatically move to the search layout. This is the code I have so far.

Sub Process_Globals

    Dim SplashTimer As Timer 

End Sub

Sub Activity_Create(FirstTime As Boolean)

    SplashTimer.Initialize("SplashTimer", 3000)
    SplashTimer.Enabled = True

    If FirstTime = True Then
        Activity.LoadLayout("splash")
    End If

End Sub

Sub SplashTimer_Tick
    Activity.LoadLayout("search")
End Sub

The problem is even though it moves to the search layout after 3 seconds, the splash layout is still visible in the background also. Can anyone please tell me how to correct this issue?

È stato utile?

Soluzione

You should load the splash layout into a Panel (with Panel.LoadLayout) and add the Panel to the activity.

Call Panel.RemoveView to remove the panel with its layout.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top