title: Screen_Off does not work in Application Level
body: <p>Screen_Off does not work in application Level ,although it is working on Activity Level.</p>
  
  <p>My Problem,when Screen goes off,it must go to Login screen,below code ,successfully go to Login screen but it cause me unregistered Receive Broadcast  </p>
  
  <p>what i have did </p>
  
  <p>if l do in Menifesty level,Screen off broadcast does not fire,</p>
  
  <p>Manifest Level</p>
  
  <pre><code>          &lt;receiver android:name="com.android.libray.ScreenReciver" android:enabled="true" &gt;
           &lt;intent-filter&gt;
               &lt;action android:name="android.intent.action.SCREEN_OFF"/&gt;
                     &lt;action android:name="android.intent.action.SCREEN_ON"/&gt;
               &lt;/intent-filter&gt;
        &lt;/receiver&gt;
  
  
  if i do in activity level,then it will fire screenReciver
  
  
    IntentFilter filter =new IntentFilter(Intent.ACTION_SCREEN_OFF);
  
              BroadcastReceiver mReceiver=new ScreenReciver();
                  registerReceiver(mReceiver, filter);
  
  public class ScreenReciver extends BroadcastReceiver {
  
      @Override
      public void onReceive(Context context, Intent intent) {
          // TODO Auto-generated method stub
           if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
                  // do whatever you need to do here
  
               Intent myintent = new Intent(context,TimerClockActivity.class);
                  myintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
                  myintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                  context.startActivity(myintent);
                  wasScreenOn = false;
               Log.v("screenoff", "Logggoff");
  
              } else if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
                  // and do whatever you need to do here
  
              }
  
  
      }
  </code></pre>
  
  <p>}</p>