0

Can I hide the Android top status bar (time & charging icon appears)? Actually there is some difference in the positing of elements when i run things on device and on emulator. I want to run my code and many different emulators for testing purpose, any help?

3 Answers 3

4

To completely remove system bar from Android Emulator(tested with Android 4.0.3):

  • Navigate to %USER_HOME%\.android\avd\avd_name.avd\
  • Edit config.ini :

    hw.mainKeys=no - turn system bar OFF
    hw.mainKeys=yes - turn system bar ON

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, this is the right answer. Config files are way more reliable than UI :P
1

Dynamically in Java

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

OR

Declare in menifest.xml like..

Add the following in application if you want to remove it for all the activities in an app: <application android:theme="@android:style/Theme.Black.NoTitleBar"> Or for a particular activity: <activity android:theme="@android:style/Theme.Black.NoTitleBar"> 

EDIT:-

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

And write following in oncreate() method.

@Override public void onCreate(android.os.Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.main); } 

1 Comment

I am asking about the system bar and i have edited the question, on which charging icon and time appears.
1

try something like this :

 <activity android:name=".MainActivity" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> </activity> 

Or do something like this before your setContentView() in onCreate

requestWindowFeature(Window.FEATURE_NO_TITLE) 

1 Comment

I am asking about the system bar and i have edited the question, on which charging icon and time appears.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.