Search code examples
androidonresume

recognize when application returns from blank screen


Is it possible to get know when my application returns to view for user, after blanking screen? In this moment application calls method onResume, and my application has crash. ("has stopped unexpectedly") I know why and I can repair this problem, but I need to know when application returns from blank screen.


Solution

  • If you're talking about the point when user unlocks the device - ACTION_USER_PRESENT is what you need. If this is not the case - please elaborate and post more details