If the device is running ICS I want to hide the status bar with:
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
But the View.SYSTEM_UI_FLAG_LOW_PROFILE parameter is defined in Android API 14.
My manifest is now:
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14" />
and
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
But then it crashes with:
java.lang.NoSuchMethodError: android.view.View.setSystemUiVisibility
What can I do to call this method and keep it compatible with Android devices with a lower api level?