Android device doesn't wake up from Activity postponed action (FLAG_TURN_SCREEN_ON set but nothing happens) -


My app receives walkcock, but can not wake device from activity

this is my code :

  create on public zeros (super.onCreate (); // Acquisition Wakelock Logic Here the new timer (). Schedule (New Timer Task) {@ Override Public Wired Run () {mHandler.obtainMessage (). SendToTarget ();}}, 30000); .....} Public handler mHandler = new handler () {Public Zero Handle Message (Message Message) {turnScreenOn (); }} Private Zero Turnscreen () {Log.i ("main activity", "current screen"); GetWindow () AddFlags (WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | Window Manager. LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); }  

In the log I see that the turn screen is executed but the screen is still closed when I am performing this method with the CREATE () and service activity - everything is fine But I want to execute it with activity. I have not received any information that is forbidden, I do not see any error in the logs.

Is it possible to wake up the activity / application without starting from the service? If this is not possible - is it a document somewhere?

Thank you in advance

I think you should go for alarm manager - You will have to register a pending notice sheet with the alarm manager and a receiver will have to get an alarm - this phone is guaranteed to carry, however you may also need a service (WakefullIntentService) for managing wakelocks. Look for the code.

BTW, Timer Task is an old way of working in a way - you will use the IIRC today to set pool editor.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -