What you learn: You will learn how to get the screen-resolution and hide the statusbar on QVGA-reoslutions (or whatever you want).
Using java Syntax Highlighting
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- final Window win = getWindow();
- final int screenHeight = win.getWindowManager().getDefaultDisplay().getHeight();
- final int screenWidth = win.getWindowManager().getDefaultDisplay().getWidth();
- if((screenHeight == 320 && screenWidth == 240) || (screenHeight == 240 && screenWidth == 320)){
- // No Statusbar
- win.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
- // No Titlebar
- requestWindowFeature(Window.FEATURE_NO_TITLE);
- requestWindowFeature(Window.FEATURE_PROGRESS);
- }
- setContentView(R.layout.mylayout);
- //... Your Code here ...
- }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
[align=center]Thats it
[/align]
Regards,
plusminus






