Site icon The Winter Blog

Snackbar

Added a snackbar confirmation on MainActivity, after addition of a successful done on NewDoneActivity.

Makes me strangely happy. Been playing with it like a kid :)

startActivityForResult(...);
...
protected void onActivityResult(int requestCode, int resultCode, Intent data){
...

if(resultCode == RESULT_OK)
Snackbar.make(findViewById(R.id.fab), R.string.done_toast_message, Snackbar.LENGTH_LONG).setAction("Action", null).show();

...
}

On the other end,

setResult(RESULT_OK);
finish();
Exit mobile version