In my application, I'd like to keep status bar but make its background be the same as the main screen.
So I created a custom theme to set application background:
<resources>
  <style name="Theme.Shelves" parent="android:Theme">
    <item name="android:windowBackground">@drawable/background_shelf</item>
    <item name="android:windowNoTitle">true</item>
  </style>
</resources>
Then put it in manifest:
 <application android:icon="@drawable/icon" 
              android:theme="@style/Theme.Shelves"
              android:label="@string/app_name">
    <activity android:name=".HelloWorld"
              android:label="@string/app_name">
And get this one:
Screen shot 2 http://i1178.photobucket.com/albums/x370/BinhNguyen84/device.png
Everything is okay except the separator line between status bar and main screen. I thought that it's because of text view padding, so I set it to zero but nothing changed.
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    
    TextView tv = new TextView(this);
    tv.setText("Hello World");
    setContentView(tv);
    tv.setPadding(0,0,0,0);
}
Judging by your screenshot the 'seperator' is actually the status bar shadow. I'm going from memory here but I think you can disable it with:
<item name="android:windowContentOverlay">@null</item>
Apologies if the attribute name is slightly wrong, as I say, going from memory but I think it's right.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With