I found a solution by myself:
@Override
public void onNavigationDrawerItemSelected(int position) {
Fragment fragment;
switch(position){
case 0:
fragment = new Fragment_main().newInstance(position+1);
break;
case 1:
fragment = new Fragment_two().newInstance(position+1);
break;
default:
fragment = new Fragment_main().newInstance(position +1);
break;
}
// update the main content by replacing fragments
FragmentManager fragmentManager = getFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.container, fragment)
.commit();
}
you just have to add a switch into this method, and also create those classes (and layouts).
I hope this solution helps everyone who also struggles as begginer or with the navigation drawer :)