Android Question Gap before main LoadLayout

rraswisak

Active Member
Licensed User
Hi all,

Every time i run b4a app there always gap (blank white screen with app title) before main layout was loaded.


loadlayout2.gif



this is Activity_Create look like;

B4X:
Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("Main")
   pnlMenu.Left = pnlMenu.Width * -1
   pnlMenu.Visible = True
   CreateCustomListMenu(True)
   ShowDashboard(False)
End Sub

is there any way to to solve this problem ?

thank you
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. Test it on a real device in release mode. It might be fast enough.

2. Make sure not to do too much work when the program starts. You can use Sleep(50) after you load the layout and then do more work.

3. Disable the layout animation by setting the duration to 0 in the layout file.

4. Use a full screen theme: https://www.b4x.com/android/forum/threads/full-screen-theme.93892/#content
 
Upvote 0

rraswisak

Active Member
Licensed User
1. Test it on a real device in release mode. It might be fast enough.
2. Make sure not to do too much work when the program starts. You can use Sleep(50) after you load the layout and then do more work.
3. Disable the layout animation by setting the duration to 0 in the layout file.
already done, seem doesn't work

This trick sove the problem, i change manifest editor with this

B4X:
SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values, colors.xml,
<resources>
   <color name="bground">#ff000000</color>
</resources>
)
CreateResource(values-v20, theme.xml,
<resources>
  <style
  name="LightTheme" parent="@android:style/Theme.Material.Light.NoActionBar.Fullscreen">
  </style>
</resources>
)
CreateResource(values-v14, theme.xml,
<resources>
  <style
  name="LightTheme" parent="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
  <item name="android:windowBackground">@color/bground</item>
  </style>
</resources>
)
 
Upvote 0
Top