Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove the battery icon in android status bar?

I've removed the status bar which shows network, battery and time information in Android by take off the background image. But the icons are still there. Just wanna know how to remove the battery icon as well.

Not for apps but for framework development. Thanks in advance.

like image 660
Jarmie Avatar asked Aug 03 '11 07:08

Jarmie


Video Answer


2 Answers

Have you tried to call

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

in Activity onCreate() ?

like image 109
Maxim Avatar answered Oct 17 '22 20:10

Maxim


If you are working on Android 2.2, you can remove it by the following step.

  1. Find StatusBarPolicy.java
  2. Find mBatteryIcon and add service.setIconVisibility(mBatteryIcon , false); for it.
  3. Remove all actions relevant to battery in the intent-filter
like image 44
Jett Hsieh Avatar answered Oct 17 '22 19:10

Jett Hsieh