Android4.0隐藏状态栏电池图标:
android4.0/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.Java
import com.android.systemui.R;
public class BatteryController extends BroadcastReceiver {
private static final String TAG = "StatusBar.BatteryController";
private Context mContext;
private ArrayList mIconViews = new ArrayList();
private ArrayList mLabelViews = new ArrayList();
public BatteryController(Context context) {
mContext = context;
IntentFilter filter = new IntentFilter();
/* delete by Gary. start {{----------------------------------- */
/* 2012-4-5 */
/* hide the battery icon in the statusbar */
// filter.addAction(Intent.ACTION_BATTERY_CHANGED);
/* delete by Gary. end -----------------------------------}} */
context.registerReceiver(this, filter);
}
public void addIconView(ImageView v) {
/* add by Gary. start {{----------------------------------- */
/* 2012-4-5 */
/* hide the battery icon in the statusbar */
v.setVisibility(View.GONE);
/* add by Gary. end -----------------------------------}} */
mIconViews.add(v);
}
public void addLabelView(TextView v) {
/* add by Gary. start {{----------------------------------- */
/* 2012-4-5 */
/* hide the battery icon in the statusbar */
v.setVisibility(View.GONE);
/* add by Gary. end -----------------------------------}} */
mLabelViews.add(v);
}