Snackbar onclick do ondismiss action
<p>Hello my App have a scanner and if the code don't correspond to anything, it show a snackbar asking the user if they want to add the scanned product to the database with a click on the snackbar button, and going to the main activity if the user dismiss the LENGTH_INDEFINITE snackbar, but when I click, it also do the ondismiss message:</p>

<pre><code>Snackbar.make(coordinatorLayoutView, "Aucun produit correspondant", Snackbar.LENGTH_INDEFINITE)  //Si il n'y a pas de produit correspondant, affiche un snackbar qui propose de l'ajouter a la base de donnée
        .setCallback(new Snackbar.Callback() {
            @Override
            public void onDismissed(Snackbar snackbar, int event) {
                Log.i("Snack", "dismiss");
                startActivity(new Intent(ScannerResultActivity.this, HomeActivity.class));
            }
        }).setAction("Ajouter", new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(ScannerResultActivity.this, ScannerResultAddProductActivity.class);
                intent.putExtra("ean", getIntent().getStringExtra("ean"));
                Log.i("Snack", "onclick");
                startActivity(intent);
                finish();
            }
        }).show();  
</code></pre>