0
Good need to open an external link for example:
https:www.google.com
However it should stay within a litem of menu list (side menu). To open the Fragments I use the position of the item, there are 7 positions as quoted below.
@Override
public void onNavigationDrawerItemSelected(int position) {
switch (position) {
case 0:
getSupportFragmentManager().beginTransaction()
.replace(R.id.container, new FragmentListaRestaurantes_())
.commit();
break;
case 1:
getSupportFragmentManager().beginTransaction().addToBackStack(BACKSTACK)
.replace(R.id.container, new FragmentFavoritos_())
.commit();
break;
case 2:
getSupportFragmentManager().beginTransaction().addToBackStack(BACKSTACK)
.replace(R.id.container, new FragmentMeusPedidos_())
.commit();
break;
case 3:
getSupportFragmentManager().beginTransaction().addToBackStack(BACKSTACK)
.replace(R.id.container, new FragmentMeusDados_()).commit();
break;
case 4:
getSupportFragmentManager().beginTransaction().addToBackStack(BACKSTACK)
.replace(R.id.container, new FragmentIndique()).commit();
break;
case 5:
getSupportFragmentManager().beginTransaction().addToBackStack(BACKSTACK)
.replace(R.id.container, new FragmentIndique()).commit();
break;
case 6:
sair();
break;
}
}
His position is 5.
My doubt is the following, I need to send it to any Fragment and redirect or I have to set the click directly from this case, calling a function that does this job ?
And how should I program this ?
I did not understand the question. No
case
can put the code you want.– ramaral