How can I check if the android phone is charging
<p>I am writing an android application. I would like to know how can I check if the phone is charging when my application starts?</p>

<p>I have read this <a href="http://stackoverflow.com/questions/6243452/how-to-know-if-the-phone-is-charging">How to know if the phone is charging</a></p>

<p>But this only register and get notified when there is a change in charging state of the phone (from charging to stop charging or vice versa). But what if the phone is charging when my application starts, how can I cover that case?</p>

<p>I have looked up PowerManager and USBManager in android. Neither has API which provides what I need.</p>

<p>Thank you.</p>
