I want to pause my game when the battery warning on Android pops up. How do I do this? I have a method that pauses the game but how do I call it when the battery warning pops up?
Android does not give you that information if you are not looking for it as far as I know.
onPause is called due to the fact that you get a pop-up on the screen, which means you are not currently running the GameActivity. You could stop there and design your game in a manner that when an external factor interrupts your activity you should pause the game when
onResume is being called.
Also to answer the "How Can I monitor battery life", you should follow this tutorial:
However pay attention to the bottom line since polling the battery life consumes mores battery than the actual usefulness of the information it gives you.
Look at this link: https://stackoverflow.com/a/21576506/1892346 . From what I know (I may be wrong) Android will handle pausing itself, the only job that you have to do is to handle Android callbacks (pause and resume methods).