Use startActivityforResult to start Activity B. Add an override of the onActivityResult (int, int, Intent) method to Activity A and setResult to ActivityB.
Example:
public class ActivityA extends Activity { static final int REQUEST_CODE = 0; @Override protected void onCreate(Bundle savedInstanceState) {
source share