I need to open an external link, for example:
https:www.google.com.br
But it should be within a menu list litem (side menu). To open the fragments I use the position of the item, there are 7 positions mentioned 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 question is the following, I need to send it to any fragment and redirect it or I can define the click directly from this case, calling a function that does this work?
And how should I program this?