No, this is the best way to do this (or, well, this is the same system that I use in my application)
Just notice, do apiTooLowForImmersive staticandpublic
public static boolean apiTooLowForImmersive = false;
and assign it a value in the block static.
static {
apiTooLowForImmersive =
(Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.KITKAT);
}
With this, you can use this field in every class and every time you need to know which code is safe to use.