I'm trying to make a lock screen app where the app shows up when the screen is awoken. I currently have a broadcast receiver that listens to ACTION_SCREEN_OFF and ACTION_SCREEN_ON and starts the activity. I have tested both of them and it seems that neither one is particularly faster than the other. Even when I listen to ACTION_SCREEN_OFF, the activity doesn't load until a bit after the screen turns on.
Is there a way to actually load the activity when the screen turns off so that it shows up immediately when the screen turns back on? Or at least is there a more efficient way of starting the activity?