Q:

Activity B notify a Activity A after calling finish()

I start Activity B from Activity A. Activity B does something to my Data and at some point I call finish();, however Activity B is still doing something with my Database in the background and when its finished I want to get notified in Activity A, that this process is finished.
Because there is no way to my knowledge to call a method from another activity I tried to solve this problem with startActivityForResult but because Im calling finish(); before actually setting a Result this does not seem to work either.
Any Idea on how to solve this problem?

A:

Don't do task in Activity that may live beyond Activity lifecycle. In that case do your task in Service and notify the Result to Activity. There are some ways to communicate between Activity and Service using BroadcastReceiver , Messenger, Handler, Bound Service . You can also use EventBus library for this  communication.
Check this and this thread for communicating between Activity and Service

