title: How to finish activity in broadcastreceiver onCallEnded()
body: <p>I have a question, how to finish activity in brodcastreceiver onCallEnded (SIP) . There is a brodcastreceiver like this:</p>
  
  <pre><code>public class IncomingCallReceiver extends BroadcastReceiver {
  
      @Override
      public void onReceive(Context context, Intent intent) {
           SipAudioCall incomingCall = null;
          try {
  
              SipAudioCall.Listener listener = new SipAudioCall.Listener() {
  
                  ...
  
                  @Override
                  public void onCallEnded(SipAudioCall call) {
  
                   // IncomingCallActivity.finish();
  
                  }
              };
  
              Main mainActivity = (Main) context;
              incomingCall = mainActivity.manager.takeAudioCall(intent, listener);
              mainActivity.call = incomingCall;
  
              Intent i = new Intent(context, IncomingCallActivity.class);  
              i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
              context.startActivity(i);
  </code></pre>
  
  <p>Then start new activity to answer or reject call, but how to close it when call is finished? Cant use <code>IncomingCallActivity.finish()</code> in <code>onCallEnded</code>.</p>