title: Unable to instantiate receiver has no zero argument constructor
body: <p>I have some Problem with using BroadCastReceiver.Here comes the AndroidManifest.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.zhang.notificationtest"&gt;
  
      &lt;uses-permission android:name="android.permission.RECEIVE_SMS"/&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
          &lt;activity android:name=".MainActivity"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity android:name=".NotificationActivity"&gt;&lt;/activity&gt;
          &lt;receiver android:name=".NotificationActivity$SMSReceiver"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.provider.Telephony.SMS_RECEIVED" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>and part of my codes</p>
  
  <p>public class NotificationActivity extends AppCompatActivity {</p>
  
  <pre><code>public TextView textViewFrom, textViewContent;
  public IntentFilter intentFilter;
  public SMSReceiver smsReceiver;
  
  @Override
  protected void onDestroy() {
      super.onDestroy();
      unregisterReceiver(smsReceiver);
  }
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_notification);
  
      textViewContent = (TextView)findViewById(R.id.textViewContent);
      textViewFrom = (TextView)findViewById(R.id.textViewFrom);
  
      intentFilter = new IntentFilter("android.provider.Telephony.SMS_RECEIVED");
      smsReceiver = new SMSReceiver();
  
      registerReceiver(smsReceiver,intentFilter);
  }
  
  public class SMSReceiver extends BroadcastReceiver{
  
      public SMSReceiver(){
      }
  
      @Override
      public void onReceive(Context context, Intent intent) {
          Bundle bundle = intent.getExtras();
          Object[] pdus = (Object[]) bundle.get("pdus");
          SmsMessage[] smsMessages = new SmsMessage[pdus.length];
          for (int i = 0; i &lt; smsMessages.length; i++)
              smsMessages[i] = SmsMessage.createFromPdu((byte[])pdus[i]);
          String from = smsMessages[0].getOriginatingAddress();
          StringBuilder content = new StringBuilder("");
          for (SmsMessage element: smsMessages)
              content.append(element.getMessageBody());
          textViewFrom.setText(from);
          textViewContent.setText(content.toString());
      }
  }
  </code></pre>
  
  <p>}
  could anyone offer me some help and tell me why it happened?Thanks a lot!</p>