I tried with the following code to hide status bar but it doesn't work..
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
and to dim the bar i used
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
and it works.. Does any one know how to hide status bar on Android 4.0.4 device??