What I want to do: hide the ActionBar (and title bar) of the application in the second or two during which the application is launched.
Ouya android devices have customized ActionBar themes to minimize problems with overscan. (Unlike Google TV, ouya devices don't have an overscan calibration procedure, so Ouya devs have added massive padding around elements in the stock ActionBar-compatible themes). This works plausibly well for dark holo, and dialog themes. Unfortunately, the default light holo theme action bars look terrible on Ouya devices.
This is causing me significant grief in the Launch animation, as I'm porting an existing Android app to Ouya.
Since I need to do a fair bit of customization to accomodate Ouya's game controllers, I thought I would not use an Action bar when I detect that I'm running on Ouya. So I call getActionBar().hide(), and then load an Ouya-specific layout with extra features for Ouya devices only.
The problem: During application launch, Android displays an empty action bar while the app is loading (just the App icon, and the app title), and does so using default themes for the activity, as read from the manifest file. The delay is fairly significant -- about two seconds or so, so the flash of the application icon and mangled ActionBar is quite visible. All of this takes place before the first line of code is executed in my app. If I set a breakpoint on the constructor of my main activity, the mangled title screen displays for a full two seconds before the breakpoint is hit.
Adding
<item name="android:windowNoActionBar">true</item>
doesn't seem to have any effect. It's possible that Android is display a titlebar instead of a dummy Action bar. adding
<item name="android:windowNoTitle">true</item>
to the application theme DOES hide the dummy action bar, but causes a long painful series of crashes in ActionBarCompat library code.
Is there a nice clean way to control what gets displayed during launch, without subsequently breaking ActionBarCompat code?
<item name="android:windowDisablePreview">true</item>
Seems to be one way to go about it, although it's a bit disturbing, since the launch now just gets delayed for two seconds. :-/
Supplementary requirements: I really would like one binary for both Ouya and regular Android devices, so manifest and style changes are undesirable if they're not going to work reasonably on all platforms.