How i can show snackbar in Activity A (coordinatorLayout is here) when my callback in Activity B is done ? Snackbar need my coordinatorLayout but i can't give it from Activity B..
Activity B :
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if(id == android.R.id.home) {
this.finish();
return true;
} else if(id == R.id.action_add) {
callAddObject();
this.finish();
return true;
}
return super.onOptionsItemSelected(item);
}
public void callAddObject() {
[...]
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Request request, IOException e) {
Log.d(TAG, "onFailure: " + e.getMessage());
// show snackbar in Activity A
}
@Override
public void onResponse(Response response) throws IOException {
Log.d(TAG, "onResponse: " + response.body().string());
// show snackbar in Activity A
}
});
}
Thanks for help.