Android Fullscreen codes not working

yousef yegane

I am using these lines to get full screen, but the bar for Battery and Antenna is still there.

requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(
        WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
        WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);

I even checked a line mentioned in How to get rid of top fading edge in android full screen mode? When I add that (setTheme(android.R.style.Theme_NoTitleBar_Fullscreen);), screen goes up, but it's kinda like the bar is on top of my screen. I naturally assume that the OS (Android 4.0.4) does not allow that, but I was said that this code will force it to be like that, nevertheless it's not working, the final code to be more precise is this:

public void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setTheme(android.R.style.Theme_NoTitleBar_Fullscreen);
        getWindow().setFlags(
                WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
        setListAdapter(new ArrayAdapter<String>(Menu.this,
                android.R.layout.simple_list_item_1, classes));
    }

Would you please help me here?

Strider

To show app in fullscreen use:

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);

To remove it use:

getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related