본문 바로가기
야매 개발실/Android

PhoneGab Android FullScreen Settings...

by 야매플머 2011. 12. 19.
반응형
There are two ways to achive this effect:
by editing DroidGap.java file
by editing Your Activity java file
 
First method - DroidGap.java
 
In Eclipse open DroidGap.java. Find the function public void onCreate(Bundle savedInstanceState). Find the lines that look like this:
 
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);


And change them to this:
 
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
               WindowManager.LayoutParams.FLAG_FULLSCREEN);
 
Second Method - Your Activity java file
 
Add the following line in onCreate of Your Activity (main class inherited from DroidGap class):
 
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                    WindowManager.LayoutParams.FLAG_FULLSCREEN | 
                    WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);

This will clear WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN flag and set WindowManager.LayoutParams.FLAG_FULLSCREEN flag for main window.
 
You will also need to add the following line to the imports:
 
import android.view.WindowManager;
반응형

'야매 개발실 > Android' 카테고리의 다른 글

[Android] Cocos2d-x 사용하기  (0) 2012.08.17