I have a SnackBar that I would like to display on another view after I am done with the current view. It's a send form so when I click the send button, I want the SnackBar to appear on the other activity since the send form one will be closed. Here's the code:
final Snackbar snackSuccess = Snackbar.make(***ViewToModifyHere?***, "Signal successfully sent.", Snackbar.LENGTH_LONG)
.setAction("Action", null)
.setDuration(2500);
snackSuccess.setAction("Dismiss", new View.OnClickListener() {
@Override
public void onClick(View view) {
snackSuccess.dismiss();
}
});
snackSuccess.setActionTextColor(Color.GREEN);
snackSuccess.setCallback(new Snackbar.Callback() {
@Override
public void onDismissed(Snackbar snackbar, int event) {
super.onDismissed(snackbar, event);
if (event != DISMISS_EVENT_ACTION) {
}
}
});
snackSuccess.show();
finish();