Android BroadcastReceiver Register Problem
<p>I am trying to register a broadcastreceiver in a small Android app that I am playing around with.  I think I am doing what I am supposed to do, but still the receiver doesn't register.  It must be something small that I am missing and it is driving me crazy.</p>

<pre><code>public class CreateReceiver extends Activity
{

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }//end of onCreate

    BroadcastReceiver myreceiver = new BroadcastReceiver()
    {
        @Override
        public void onReceive(Context recvc, Intent recvi)
        {

        }
    };

    @Override
    public void onResume()
    {
        super.onResume();

        IntentFilter intentFilter = new IntentFilter(Intent.ACTION_CAMERA_BUTTON);

        if (this.registerReceiver(myreceiver, intentFilter) == null) 
        {
            Toast.makeText(this, "Could not register receiver", Toast.LENGTH_LONG).show();
        }//end of if
    }//end of onResume

    @Override
public void onPause()
{
    this.unregisterReceiver(myreceiver);
    super.onPause();
}//end of onPause
}//end of CreateReceiver
</code></pre>

<p>Can anyone tell me what I am doing wrong?  Thanks.</p>
