How to remove the battery icon in android status bar?

僤鯓⒐⒋嵵緔 提交于 2019-12-07 01:59:37

问题


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.


回答1:


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



回答2:


Have you tried to call

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

in Activity onCreate() ?



来源:https://stackoverflow.com/questions/6922878/how-to-remove-the-battery-icon-in-android-status-bar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!