title: Turn the screen backlight on when my application receive notification
body: <p>I need to turn the screen backlight on when my application receive notification.
  I get the sound, LED light on and vibration but the screen stays off.</p>
  
  <p>I tried using PowerManager: </p>
  
  <pre><code>PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
  PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag");
  wl.acquire();
  ..screen will stay on during this section..
  wl.release();
  </code></pre>
  
  <p>But without result.</p>
  
  <p>The notification code looks like:</p>
  
  <pre><code>public void showNotification( String contentTitle, String contentText ) {
     int icon = R.drawable.notification;
     long when = System.currentTimeMillis();
  
  
  
     Notification notification = new Notification(icon, contentTitle, when);
  
  
     notification.flags |= Notification.FLAG_AUTO_CANCEL;
     notification.defaults |= Notification.DEFAULT_LIGHTS;
  
  
  
  
     Intent notificationIntent = new Intent(this, myapp.class);
     Context context = this.getApplicationContext();
  
  
     PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
     notification.setLatestEventInfo(this, contentTitle, contentText, contentIntent);
  
     NotificationManager nm = (NotificationManager)this.getSystemService(Context.NOTIFICATION_SERVICE);
  
  
  
  
     Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
     v.vibrate(300);
  
     notification.sound = Uri.parse("android.resource://" + context.getPackageName() + "/" + R.raw.sonar_ping);
  
     notification.flags |= Notification.FLAG_SHOW_LIGHTS;
     notification.ledARGB = 0x00000000;
     notification.ledOnMS = 0;
     notification.ledOffMS = 0;
  
     nm.notify(1, notification);
  
  
  
  
  }  
  </code></pre>
  
  <p>How to turn on the screen when the notifications appear in the status bar?
  What do I need to add in this code to achieve that?</p>
  
  <p>Thanks for any advice and help.</p>