Set Actionbar overlay mode at runtime in Android
android, android-4.0-ice-cream-sandwich, android-actionbar
Solution
Although not necessarily exactly what you're looking for, one decent workaround would be to create a spacer view at the top of the content that is the same height as the ActionBar (android:layout_height="?android:actionBarSize"). When you want overlay mode enabled, set the spacer's visibility to View.GONE, when you want it disabled, set it to View.VISIBLE.
Problem
How do I set the `actionbar` mode at runtime to not-overlay or overlay with the content at runtime? I tried using `getWindow().requestFeature(Window.FEATURE_ACTIONBAR_OVERLAY)` but it doesn't allow to set the mode after calling `setContentView()`. This can be done, as I have seen it being done in the Youtube app.