I’m not sure if this is a Nexus 4 issue, or happens to every Android device. But from time to time mine decides to stay awake, even if I’m doing nothing with it. Stopping Foursquare put the phone on sleep mode again, so if you have this issue try it, it may help.
I know of a bug on the Mail app that makes the phone stay awake whilst on the train. I suppose that as it looses and regains signal, the app enters in some kind of infinite loop trying to check the network and download mail. It means that unless I kill the app, every time I go see a client my phone is dead in an hour.
Some Fridays ago I was having some drinks with my Webcredible colleagues. Battery was doing fine, and I hoped to have some left to listen to music on my train back home. Then we moved into a pub, I checked-in on Foursquare and… zas, my phone turned into a heat emitting device capable of frying a steak. Battery was dead a few minutes later, something my wife didn’t appreciate.
So when my phone got into hot pan mode a few days ago, I decided to investigate a bit. As you can see on the screenshot, there was a drastic use of energy going home (1). That’s normal, as I was using Spotify and checking some news. Problem is, I got home, stopped using my phone at all, but it was still quickly draining the battery.
A quick charge later, battery was still draining at a ridiculous rate, so we checked what was running in the background. Foursquare was there pretty high on the list, even if I don’t use it at all. So I killed the app (actually uninstalled it), and as you can see (2) my phone went into sleep mode again. That’s probably what happened that Friday night, Foursquare kept running in the background in some kind of infinite loop.
I’m sure there are other apps that do exactly the same, so if you have this issue and don’t use Foursquare, simple go to Settings > Battery, check what’s using it and kill it. Quite likely that is some app checking your location or trying to sync information.