Android Question Best way to do a splash screen at app startup

Discussion in 'Android Questions' started by Kevin Hartin, May 11, 2019.

  1. Kevin Hartin

    Kevin Hartin Member Licensed User

    What is the best way to do a splash screen?
    1. Use a panel in main that goes invisible after a while or on click
    2. Create an activity that is called from main at end of Activity_Create
    3. Some other way
    My app is a OSMDroid tour app that the main layout is all built in Activity_Create rather than the designer. If this makes a difference...

  2. Scantech

    Scantech Well-Known Member Licensed User

    This is the way i do it. You can use a Timer to set the Image to false after certain amount of time.
    I use 3 doevents.. cause some device will not display the image with less then 3.
    Also, might want to use BringtoFront in case you load other layouts.
    Sub Activity_Create(FirstTime As Boolean)
    end sub
    Sub LoadSplashVersion

    Activity.AddView(imvSplash, 00250dip50dip)        'originally at 250dip, 50dip
        imvSplash.Left             = (
    Activity.Width - imvSplash.Width)   /2
        imvSplash.Top              = (
    Activity.Height - imvSplash.Height) /2
        imvSplash.Gravity         = 

        imvSplash.Bitmap         = 
    LoadBitmap(File.DirAssets, "CarGaugeSplash2.png")
        imvSplash.Visible         = 

    End Sub
    Kevin Hartin likes this.
  3. Kevin Hartin

    Kevin Hartin Member Licensed User

    Thanks Scantech, I will give it a try.

    What are the 3 DoEvents :
  4. Scantech

    Scantech Well-Known Member Licensed User

    Last edited: May 12, 2019
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice