1

I am working on an android aap and i want to hide action bar for small screen (240x320) only not for normal and large screen. Is it possible to hide if it is then how?

KulArtist
  • 965
  • 8
  • 20

2 Answers2

4

then you need to get the dimenstion first..

here's how to get the dimension:

Display display = getWindowManager().getDefaultDisplay(); 
int width = display.getWidth();
int height = display.getHeight();

see answers here on how to get the screen dimension

here's how to hide action bar

    getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
    getActionBar().hide();

Addition for v7 support actionbar user, the code will be:

getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
getSupportActionBar().hide();

see answers here on how to hide action bar

Community
  • 1
  • 1
Dyrandz Famador
  • 4,499
  • 5
  • 25
  • 40
2

Hide the Status Bar on Android 4.0 and Lower

<application
...
android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen" >
...

Or Must be before setting the layout.

requestWindowFeature(Window.FEATURE_NO_TITLE);

For more information you may visit Here .

IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198