I am developing an application where I start a background service and I want my main activity to perform a certain action when the service stops
I tried this in my service
public void onDestroy() {
myActivity.getInstance().performAction();
}
however this causes timeout service exception as the service doesn't stop except when this action is completed and this action takes a lot of time
how can I get around that . Any suggestions ?