/*对系统版本为4.4及以上的开启 透明状态栏和导航栏(即沉浸式状态栏)*/
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window window = getWindow();
// Translucent status bar
window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
// Translucent navigation bar
window.setFlags(
WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
// isSdkHeigthThanKitkat = true;
}对系统版本为4.4及以上的开启 透明状态栏和导航栏(即沉浸式状态栏)
原文:http://blog.csdn.net/super_spy/article/details/43564611