Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problemi con la bottom navigation bar #1

Open
BraindeadHermit opened this issue Nov 25, 2021 · 0 comments
Open

Problemi con la bottom navigation bar #1

BraindeadHermit opened this issue Nov 25, 2021 · 0 comments

Comments

@BraindeadHermit
Copy link

BraindeadHermit commented Nov 25, 2021

Bug nello switch delle activity

Se dalla BottomNavigationView vado in Tutorial e da li provo ad accedere ad una qualsiasi delle altre Activity della app mi porta sempre alla sezione VENDI.
Credo che l'errore sia dovuto all'assenza di break; nei vari case nel metodo BottomNavigationView.OnNavigationItemSelectedListener in activity_tutorial:

switch (item.getItemId()) {
case R.id.home:
boolean creata = datiTemporanei.getIncubataCreata();
Intent intent1;
if (creata) {
intent1 = new Intent(context, activity_oggi.class);
} else{
intent1 = new Intent(context, MainActivity.class);
}
startActivity(intent1);
case R.id.listaIncubata:
Intent intent2 = new Intent(context, activity_list.class);
startActivity(intent2);
case R.id.vendite:
Intent intent4 = new Intent(context, activity_vendita.class);
startActivity(intent4);
case R.id.tutorial:
//Toast.makeText(context, "Sei nella sezione tutorial!", Toast.LENGTH_LONG).show();
break;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant