Hi,

I have a map activity for which I would like to have the screen turned
on as long it's active (the app consists of one activity only). When
the activity is paused or stopped I want to return to normal on/off
mode. Keeping the screen on works fine while the app is running but
when I exit the app the screen stays on as well. What am I missing?

public void onCreate(...) {

      getWindow().addFlags
(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
      setContentView....
}


public void onPause(...) {

      getWindow().cleaFlags
(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}

public void onResume(...) {

      getWindow().addFlags
(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

}

public void onStop(...) {

      getWindow().cleaFlags
(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to