Android - Broadcast Receiver screen off to Intent, not working....?
<p>I have code below that I have inserted into my onCreate method, but it dosent seem to work.
I want it to launch other activity when screen goes off/battery button press. </p>

<p>CODE:</p>

<pre><code>protected void onStartCommand() {
    // TODO Auto-generated method stub
    super.onStart();
    ScreenReceiver();
}

 public class ScreenReceiver extends BroadcastReceiver {

      @Override
        public void onReceive(Context context, Intent intent) {

            if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {

                lock.reenableKeyguard();        
                Intent s = new Intent(Activity1.this , Activity2.class); 
                startActivity(s);


            } 
            else if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
                lock.disableKeyguard(); 



            }
        }
    }
</code></pre>

<p>Any help would be VERY appreciated? </p>
