Turning on screen from receiver/service

后端 未结 3 1882
再見小時候
再見小時候 2020-11-27 17:31

I would like my app to be able to turn the screen on and display my app. Let\'s say I\'m setting an alarm and every hour I want my app to be displayed for 2 mins before the

3条回答
  •  情话喂你
    2020-11-27 17:38

    I don't know what you're talking about, wakelock is definitely not deprecated. Certain types are no longer the Google preferred way of doing things, but normal wakelocks are still around and still the easiest way of doing this. Make sure to add the ACQUIRE_CAUSES_WAKEUP flag when taking the lock. In fact notice that a WakefulBroadcastReceiver is implemented by using wakelocks.

提交回复
热议问题