Hide Status Bar on Android in PG 2.1.0?

130 views
Skip to first unread message

Fly_Molo

unread,
Dec 17, 2012, 12:24:24 PM12/17/12
to phon...@googlegroups.com
I have an android project that I'm updating from 1.8 to 2.1.0 and one of the things I want to fix is that the status bar is showing at the top of the screen.  Easy to remove on iOS, but I can't find a good solution on Android.  

I did try adding: 

    android:theme="@android:style/Theme.NoTitleBar"  

to the AndroidManifest.xml with no effect.

Are there any other options? 

Fly_Molo

unread,
Dec 17, 2012, 5:34:39 PM12/17/12
to phon...@googlegroups.com
I found a fix.  

I needed to add the "getWindow()..." code to my main activity java file like so:

@Override

    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        //setContentView(R.layout.activity_main);

        // remove status bar so app will be full screen

        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN

             WindowManager.LayoutParams.FLAG_FULLSCREEN

            WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);

        super.loadUrl("file:///android_asset/www/index.html";        

}

Also, I needed to add: 

import android.view.WindowManager;

to the imports at the top. 


Thanks

Reply all
Reply to author
Forward
0 new messages