title: How can I turn on screen when my app running in background of a program?
body: <p>I have a program which runs another program.
  I want to prevent the user from pressing the power button to turn the screen off and if the user turned the screen off , my program turns it back on!</p>
  
  <p>For this I implement a <strong>broadcast receiver</strong> that catches the <strong>screen off</strong> event, then it calls a <strong>service</strong> to run an <strong>activity</strong> and in this <strong>activity</strong> I will turn the screen <strong>on</strong> and that <strong>activity</strong> then runs my desired program ...</p>
  
  <p>This plan works fine when I'm not running that app and the screen goes on when the user presses the power button! But when my desired application is running, my program does not work properly in the background! Sometimes it turns the screen on, sometimes it doesn't!</p>