I want to examine whether the battery icon and level in status bar are changed correctly, so I want to get the Battery Icon Resource ID or the full file path/name in Status Bar.
I tried to use the Battery Manager to get the icon's resource ID:
intent.getIntExtra(BatteryManager.EXTRA_ICON_SMALL, 0)
However, I encountered the same problem as the author did: Android: access "system"-drawables
I get the same icon, whose path is /res/drawable/stat_sys_battery.xml
, no matter what the level is. I am eager to know why is this icon not the same with status bar's icon? My goal is to get the status bar's icon.
I have searched for the answer for quite a while, but most posts on this topic pertain to changing the battery icon in status bar, whereas my question is on how to get the status bar's status and icon, i.e. I do not want to modify the icon.
Please help me! Thanks in advance.