title: BroadcastReceiver for screen lock not being triggered
body: <p>I'm trying to turn the GPS location updates off when the screen locks. Having read the answer to this question <a href="https://stackoverflow.com/questions/1588061/android-how-to-receive-broadcast-intents-action-screen-on-off">Android - how to receive broadcast intents ACTION_SCREEN_ON/OFF?</a></p>
  
  <p>I've written some code to implement a BroadcastReceiver but it's not working when the screen goes off.</p>
  
  <p>I've registered a BroadcastReceiver in my code with</p>
  
  <pre><code>@Override
  public void onResume() {
      super.onResume();
      IntentFilter iFilter = new IntentFilter();
      iFilter.addAction("android.intent.action.ACTION_SCREEN_ON");
      iFilter.addAction("android.intent.action.ACTION_SCREEN_OFF");
      registerReceiver(screenStatReceiver, iFilter);
  </code></pre>
  
  <p>and the receiver itself is just a stub for now:</p>
  
  <pre><code>    public BroadcastReceiver screenStatReceiver = new BroadcastReceiver() {
  
         @Override
         public void onReceive(Context context, Intent intent) {
         // TODO Auto-generated method stub
         Log.d("BCAST_TAG", "Got broadcast");         
         String action = intent.getAction();
  
         }
  };
  </code></pre>
  
  <p>and in the manifest I have:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
  </code></pre>
  
  <p>Any ideas as to why it's not being triggered when I debug it on my phone?</p>