Problem with Navigation Drawer (query)

0

I'm getting into Android Studio and I need to get a question out.

On the one hand I have a Activity that within you has 2 fragment ( Data and Details ) where the 2nd reacts depending on what is selected in the first one.

On the other hand I have a Navigation Drawer , which as I understand it uses only fragments , so I can not insert it into the aforementioned activity . How could I do to link these 2 parts?

Try to create a Fragment(Container) that inside you have Data and Details but calling it from NavigationActivity gives me an error. Thank you very much

    
asked by DavidC 21.02.2018 в 17:25
source

1 answer

0

Pass the other fragments dynamically!

This is the code:

FragmentTransaction transaction;
                    Nombre_fragment fragment = new Nombre_fragment();
                                           transaction = getSupportFragmentManager().beginTransaction().replace(R.id.El Drawer, *fragment*);
                   transaction.addToBackStack(null);
                    transaction.commit();
    
answered by 21.02.2018 / 17:49
source