title: register sms receive intent from activity
body: <p>I have a receiver private to my activity class. I want to register my receiver for intent <code>"android.provider.Telephony.SMS_RECEIVED"</code>. I am able to do so from manifest file but not from my activity.
  Activity code for registering receiver:</p>
  
  <pre><code>IntentFilter filter = new IntentFilter("android.provider.Telephony.SMS_RECEIVED");
  
  registerReceiver(receiver, filter);
  </code></pre>
  
  <p>Receiver code : </p>
  
  <pre><code> private BroadcastReceiver receiver = new BroadcastReceiver() {
  
              @Override
              public void onReceive(Context context, Intent intent) {
  
                 //some action
  
              }
          };
  </code></pre>
  
  <p>Please tell if it is possible to do so, and if yes then how.</p>