1

I have uploaded some data on Amazon so when process is going on, I use getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); but after all processes are done I want to turn off the screen light again. How is it possible?

Johan Falk
  • 4,341
  • 2
  • 30
  • 42
Bhanu Sharma
  • 5,135
  • 2
  • 24
  • 49
  • you can refer the below link. http://stackoverflow.com/questions/9561320/android-how-to-turn-screen-on-and-off- programmatically – Mohit Dec 05 '13 at 09:50

1 Answers1

1

You can clear flags, that you added, by using getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)

http://developer.android.com/reference/android/view/Window.html#clearFlags%28int%29

Denys Vasylenko
  • 2,135
  • 18
  • 20
  • after setcontentview() it will be work ?? because i wrote above addFlags before setcontentview(). – Bhanu Sharma Dec 05 '13 at 10:02
  • actually i also know about this but some one told me that it only write before setcontantview(); hahahaha so i didn't use this but thanks dude – Bhanu Sharma Dec 05 '13 at 10:23