First Screen on App Load (Before Splash or the App screen)

bloxa69

Active Member
Licensed User
Longtime User
I did really extensive search and couldn't find any info on how to modify or disable that first screen that you get even before the app loads - the blank page with a gray gradient and your app's icon and name on top. Usually it switches to the app's UI really quick but sometimes it stays there for a sec or two. I'd like to remove it completely or at least, if it's not possible, modify it or add some text to it, like "Application Loading..." or something.
Any ideas?
 

bloxa69

Active Member
Licensed User
Longtime User
Thanks for the feedback gents. It's not a blank screen and I don't see it anywhere except B4A. I think it only happens when you target SDK 14+. Please see attached image (I've used B4A Designer App as example, but it happens with all of the apps.) I got the feeling it might be disabled somewhere in the manifest, but I'm not sure.
 

Attachments

  • TempImage1.jpg
    TempImage1.jpg
    20.5 KB · Views: 476
Upvote 0

bloxa69

Active Member
Licensed User
Longtime User
I did some more testing and research on Android forums, and this is how I got rid of it:
B4X:
SetApplicationAttribute(android:theme, @android:style/Theme.NoTitleBar.Fullscreen)

Just added this to Manifest Editor script in B4A. Now it's just a blank screen, but I think it's better for it doesn't look like the app started and froze and then loaded another app, or something. In most cases it's very brief, so I can live with it being blank. As a downside, it removes the status bar of the device completely and makes the app full screen, so I guess I then will have to enable the title bar back after the app starts, from the app's code.

Still, I would like to know if it's possibly to keep that first original (notification?) screen with the title bar and just add "Loading App" to it? Or completely disable it somehow, so when you tap the app's icon, it jumps to the app UI right away, no additional, even brief, screens.

Thanks for the help everybody.
 
Upvote 0

bloxa69

Active Member
Licensed User
Longtime User
One more try and now it's not full screen, all device status bars are intact, just getting a brief back blank screen before the apps loads.

B4X:
SetApplicationAttribute(android:theme, @android:style/Theme.NoTitleBar)

I'm still curious though, if it's possible to modify or disable that first screen completely.
 
Upvote 0

bloxa69

Active Member
Licensed User
Longtime User
Figured out what it was. It's the Main Activity background while it's loading all my app's elements (a lot). So it took a while - almost a sec, 2 sec on a slower device. Fixed it by adding a panel to activity before loading anything else and then rendering the panel to the screen with "doevents". That panel shows up right away, no delays now. I can add any views to it, like a splash screen animation or anything. When the apps elements are loaded, they just cover that panel, I even don't have to remove it.

Thanks everybody.
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Sure it's not just the b4a designer view (which we work on while developing) which simply appears irrelevantly of your app?
 
Upvote 0

bloxa69

Active Member
Licensed User
Longtime User
I only used B4A designer app to make a screenshot to show how it looks like (mine app was too quick to capture a screenshot). I am 100% positive now it's my app's Main Activity bg with the title showing while the UI is building. To get rid of it, I just added a panel and a small loading graphic to the main activity before any other code and then ran "doevents". It renders the first panel to the screen immediately and then the app just builds the UI on top of it (0.5-1.5sec).

So far it worked out nicely though I couldn't animate the graphic on that first (splash) panel - animation lib just doesn't work on it while the UI is building in the memory.

B4X:
Dim SplashWindow As Panel
Dim splashIcons(2) As Bitmap
Dim centerIcon As ImageView
Dim bd As BitmapDrawable

SplashWindow.Initialize("")
   Activity.AddView(SplashWindow,0,0,100%x,100%y)
   SplashWindow.Color = Colors.Black
         DoEvents

      centerIcon.Initialize("")
      splashIcons(0).InitializeSample(File.DirAssets, "app_icon_300.png", Min(50%x,50%y), Min(50%x,50%y))

      bd.Initialize(Main.splashIcons(0))
      centerIcon.Background = bd            
      SplashWindow.AddView(centerIcon,50%x - Min(50%x,50%y)/2,50%y - Min(50%x,50%y)/2,Min(50%x,50%y),Min(50%x,50%y))
      
DoEvents
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
B4X:
Activity.LoadLayout("Layout1")
pnlevent.Top=0
pnlevent.Left=0
pnlevent.Width=Activity.Width 
pnlevent.Height=Activity.Height
pnlevent.Color=Colors.Yellow
DoEvents
' some activity create statements

pnlevent.left=activity.width 'hide you splash screen


'You can try the above where the pnlevent panel can contain any background you want
 
Last edited:
Upvote 0
Top