Starting activity from service on lock screen turns on the screen but does not show the activity itself

前端 未结 3 1528
南旧
南旧 2020-12-16 00:23

I\'m trying to start an activity from a service I had already acquired the lock for as follows:

Intent i = new Intent(context, MyActivity.class);
i.setFlags(         


        
3条回答
  •  無奈伤痛
    2020-12-16 01:07

    Since my application already includes a Service, this is what I do: if the screen is locked, I register a broadcast receiver (a bit simpler than this one, since it reacts only on unlocking) that starts the Activity as soon as the screen gets unlocked.

提交回复
热议问题