Bug? Title briefly shown on start-up when #IncludeTitle set to False

RandomCoder

Well-Known Member
Licensed User
Longtime User
@Erel and anyone else that may be able to offer a work around solution.

This issue has been raised before by @barx Title not hiding properly

But the solution to set 'SetApplicationAttribute(android:theme, "@android:style/Theme.Holo.NoActionBar")' in the manifest file does not work for me because I want to use the stdActionBar in my app, and if I apply this statement it causes a null reference exception when attempting to initialise the stdActionBar.

I also read that it can be caused due to using the designer and the time taken to load a layout. But I do not think this is the case. Making the above mentioned change to the manifest file works and provides the desired effect of completely removing the ActionBar during start-up, but it also means that it is no longer possible to use it at any time in the App as I believe that it is not possible to undo this setting?

Please view these two short clips, the first video demonstrates the bug. The Activity is set to be full screen and without titlebar but there is a brief glimpse of the App title. The second clip shows the same app but with the manifest alteration.

I've also provided a link to my code (file size to big to upload due to splash image :(), you will see that I have attempted to load a blank panel and apply this to the Activity on start-up then half a second later load the layout. This was my attempt at removing any delay possibly caused by loading a layout.

In my naive mind I think that the problem is that the Activity is being loaded before the IncludeTitle property has been checked? I'm sure that it's probably not that simple though as I'm certain you would have fixed it before now. Is there anything else I can try or do we just have to live with it?



To run this test app the stdActionBar library will also be required.
https://www.dropbox.com/s/2c4a77nu6aatr6a/Splash_Test.zip?dl=0

Kind Regards,
RandomCoder
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
I was just attempting to create a splash screen which will be shown whilst my app is preparing itself. I then intend to use the stdActionBar and Menu in the app.
I also tried using the SplashFade library but that too displays the same glimpse of the App title. Is there another way to show a splash screen?
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
You can start with a full screen activity (by setting the activity theme instead of the application theme) and then switch to a non-full screen activity. However you may encounter a different issue where the activity height reported is not adjusted properly.
This is exactly what I have done and what creates the bug. In my first post I said...
In my naive mind I think that the problem is that the Activity is being loaded before the IncludeTitle property has been checked? I'm sure that it's probably not that simple though as I'm certain you would have fixed it before now. Is there anything else I can try or do we just have to live with it?
 

moster67

Expert
Licensed User
Longtime User
Just "thinking out loud" what I would try: the xmllayoutbuilder library

Maybe defining a start layout in xml (standard Google way) and test to see if there any improvements or not....
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
@moster67 I'll give it a try but expect that it will produce exactly the same result as the code is still called from within Activity_Create. But I'll definately give it a whirl when I get home tonight.
Thanks.
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
It will not help. The activity is created and then the title is removed. All this happens before your code is executed.
This is as I expected, but is it possible to check the activity attributes before creating the activity? Or does the system design not lend itself to doing this?

I'm only a hobbyist programmer and so it doesn't really matter that much to me, but I've found it quite annoying not to be able to fix. It just lacks that feeling of professionalism and I believe that first impressions are very important.

I understand that it is probably quite rare to have a program start full screen without titlebar and then use the title bar. Maybe you could consider providing a splash screen alternative?

Thanks for answering,
RandomCoder
 

corwin42

Expert
Licensed User
Longtime User

RandomCoder

Well-Known Member
Licensed User
Longtime User
Very interesting, than you @corwin42
I've not read it all yet but intend to later.
 
Top