title: broadcast receiver not working (not getting called)
body: <p>So I am registering a broadcast receiver in activity A</p>
  
  <pre><code>BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
  
      @Override
      public void onReceive(Context arg0, Intent intent) {
          String action = intent.getAction();
          if (action.equals("finish_activity")) {
              finish();
          }
      }
  };
  </code></pre>
  
  <p>(directly in the class)</p>
  
  <p>and unregistering it </p>
  
  <pre><code>@Override
      protected void onStop() {
          super.onStop();
          unregisterReceiver(broadcastReceiver);
      }
  </code></pre>
  
  <p>.
  When I try to call it from activity B</p>
  
  <pre><code>Intent finishCheckALoanActivityIntent = new Intent("finish_activity");
              sendBroadcast(finishCheckALoanActivityIntent);
  </code></pre>
  
  <p>(which was started by activity A some time ago (not sure if it matters))
  it doesn't finish the activity A. In other words the broadcast receiver doesn't get called. (PS: I am also using finish() in my activity B right after I call the receiver to finish activity A).
  I tried debugging it. I've put a breakpoint in the <code>onReceive</code> method but the breakpoint doesn't get hit.</p>