Android Question How to hide initial/default activity until layout loads

JohnC

Expert
Licensed User
Longtime User
When my app first starts, an activity with the Titlebar showing my app's name and a black body is very briefly displayed, then the layout I am loading in the Activity_Create is displayed.

How can I prevent this unknown initial/default activity from displaying before my actual desired layout is loaded?

I even have the below in the "Main" activity:
B4X:
#Region  Activity Attributes
    #FullScreen: false
    #IncludeTitle: False
#End Region
 

moster67

Expert
Licensed User
Longtime User
I've seen this as well and it has been discussed on numerous occasions here in the forum. Lately I have been developing with Android Studio and I cannot recall seeing this.

One thing you could try is to use the XMLLayoutBuilder library and see if you note any improvements.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User

The three dots will appear automatically:



Just remove the inline java code that was added in the example.

The complete code to test it:
B4X:
#Extends: android.support.v7.app.AppCompatActivity

#Region  Activity Attributes
   #FullScreen: False
   #IncludeTitle: True
#End Region

Sub Process_Globals

End Sub

Sub Globals

End Sub


Sub Activity_Create(FirstTime As Boolean)
   'Do not forget to load the layout file created with the visual designer. For example:
   Activity.LoadLayout("layout1")
   Activity.AddMenuItem("Test1", "test")
   Activity.AddMenuItem("Test2", "test")
End Sub

Sub test_click
   Log("click")
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…