urSus
urSus

Reputation: 12739

Splashscreen - getActionBar().hide still flashes for a second

I am trying to implement a splashcreen and I dont want to use a new activity for the splashscreen,

So I set visibility=gone on my listview, hide actionbar, leave the logo visibility=visible, sleep for a certain period and then show the actionbar again and set the listview visibility back to visible

This works, however there is a brief moment at the start when the actionbar is still visible before it gets hidden

Is there a way to fix this and have the actionbar be gone from the beginning?

I am using ActionBarSherlock and Galaxy S3 with 4.1 Jelly Bean.

Thanks

Upvotes: 1

Views: 1001

Answers (1)

Jake Wharton
Jake Wharton

Reputation: 76075

No. There is no way to do this without using two separate activities.

The action bar is initialized as part of the decor view which happens much earlier than your onCreate method. This means there will be the noticeable lag that you describe before it can be hidden. If you wanted to permanently hide it you could do so using a theme or window flag but once you do that there is no way to get it to appear.

Upvotes: 2

Related Questions