title: Android: How can I get Battery Icon Resource ID or full file path/name in Status Bar?
body: <p>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.</p>
  
  <p>I tried to use the Battery Manager to get the icon's resource ID:</p>
  
  <pre><code>intent.getIntExtra(BatteryManager.EXTRA_ICON_SMALL, 0)
  </code></pre>
  
  <p>However, I encountered the same problem as the author did:
  <a href="https://stackoverflow.com/questions/4891598/android-access-system-drawables">Android: access &quot;system&quot;-drawables</a></p>
  
  <p>I get the same icon, whose path is <code>/res/drawable/stat_sys_battery.xml</code>, no matter what the level is.  I am eager to know <strong><em>why is this icon not the same with status bar's icon</em></strong>? My goal is to get the status bar's icon.</p>
  
  <p>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.</p>
  
  <p>Please help me! Thanks in advance.</p>