Android Status Bar visibility Cordova 2.0.0

1,078 views
Skip to first unread message

Robert Schmuecker

unread,
Sep 13, 2012, 5:00:20 AM9/13/12
to phon...@googlegroups.com
Hi All,

Can anyone perhaps enlighten me as to why an app on Android 2.3 based on Cordova 1.7.0 displays the status bar by default but if you swap in Cordova 2.0.0 it gets taken away and the app goes fullscreen?
Is there a way to explicitly display the status bar in Cordova 2.0.0?
Many thanks in advance for your replies.

R.

anis....@nitobi.com

unread,
Sep 13, 2012, 8:03:16 PM9/13/12
to phon...@googlegroups.com
Not sure if we're talking about the same thing. Do you meant the title bar ?

In which case you can add/remove this line to your activity element in your AndroidManifest.xml to enable/disable it:

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

cheers

Anis

Robert Schmuecker

unread,
Sep 14, 2012, 6:44:30 AM9/14/12
to phon...@googlegroups.com
Hi Anis,

Many thanks for your reply.  I actually want the indicated behaviour of 1.7.0 i.e. the natofication/status bar to show - so that the signal strength and wifi connectivity etc is still visible on the screen.  Simply by swapping out 1.7.0 with 2.0.0 it hides it and I have even tried explicitly setting the FLAG_FORCE_NOT_FULLSCREEN when using Cordova 2.0.0 in my activity's onCreate method as below and it doesn't help.  Any ideas as to why this might be happening?

Many thanks in advance,

Rob.

package smilezone.Reporter;

import android.os.Bundle;
import org.apache.cordova.*;
import android.view.WindowManager;

public class SmileZoneReporterActivity extends DroidGap {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    //Show notification bar
    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
        super.onCreate(savedInstanceState);
        super.setBooleanProperty("keepRunning", true);
        super.setIntegerProperty("splashscreen", R.drawable.splash);
        super.setIntegerProperty("loadUrlTimeoutValue", 60000);
        super.loadUrl("file:///android_asset/www/index.html", 8000);
    }
}

Robert Schmuecker

unread,
Sep 15, 2012, 5:24:31 AM9/15/12
to phon...@googlegroups.com
Hi Anis,


Please accept my apologies.  I have found what the issue was and seemingly have wasted your time . . . There was a preference lurking in the config.xml  which obviously the older 1.7.0 version doesn't regard.
<preference name="fullscreen" value="true" />
Removing this brought back the expected behaviour.  

Many thanks for your efforts,
Rob.
Reply all
Reply to author
Forward
0 new messages