title: Android BroadcastReceiver: Unable to instantiate receiver - no empty constructor
body: <p>I have a problem with a BroadcastReceiver. If I declare the action in the manifest in this way:</p>
  
  <pre><code>    &lt;receiver android:name="com.app.activity.observer.DataEntryObserver" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name= "@string/action_db_updated" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  </code></pre>
  
  <p>where in the strings.xml I have:</p>
  
  <pre><code>       &lt;string name="action_db_updated"&gt;com.app.DB_UPDATED&lt;/string&gt;
  </code></pre>
  
  <p>everything works well. But if I change it to:</p>
  
  <pre><code>    &lt;receiver android:name="com.app.activity.observer.DataEntryObserver" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name= "com.app.DB_UPDATED" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  </code></pre>
  
  <p>I have this exception as the receiver is called:</p>
  
  <p>java.lang.RuntimeException: Unable to instantiate receiver com.app.activity.observer.DataEntryObserver: java.lang.InstantiationException: can't instantiate class com.app.activity.observer.DataEntryObserver; no empty constructor</p>
  
  <p>I would keep the working version but the Play store doesn't allow me to publish the app because it expects a string value and not a variable @string/..</p>
  
  <p>my receiver is an outerclass and is defined as:</p>
  
  <pre><code>   public class DataEntryObserver extends BroadcastReceiver{
  
  private AppUsageLoader dLoader;
  
  
  public DataEntryObserver(AppUsageLoader dLoader) {
      this.dLoader = dLoader;
  
      IntentFilter filter = new IntentFilter(
              ReaLifeApplication.ACTION_DB_UPDATED);
      dLoader.getContext().registerReceiver(this, filter);
  }
  
  
  @Override
  public void onReceive(Context arg0, Intent arg1) {
  
      // Tell the loader about the change.
      dLoader.onContentChanged();
  
  }
  </code></pre>
  
  <p>}</p>