Locking screen of Android phone results in several subsequent onPause/onResume events
问题 I encountered this somewhat strange behavior while developing on Android and during my googling the only answer I could find was that this is by design and that I should not care about it. My application fetches location data while active, and I was about to implement a way to preserve battery by stopping location updates when the onPause event is called, and later resume fetching when the onResume event is called. While debugging I noticed this strange behavior when locking the phone,