Communication from BroadcastReceiver to Activity is cracky; what if activity has already disappeared?
If I were you, I would install a new BroadcastReceiver inside an Activity that would receive a CLOSE message:
private BroadcastReceiver closeReceiver;
closeReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String value = getIntent().getStringExtra("name");
finish();
}
};
registerReceiver(closeReceiver, new IntentFilter(CLOSE_ACTION));
SMS BroadcastReceiver :
Intent i = new Intent(CLOSE_ACTION);
i.putExtra("name", "value");
context.sendBroadcast(i);
, ?