Go from a fragment of the Drawer Navegation to another activity [closed]

0

Goodbye everyone, I have a huge problem, I created a Drawer Navigation Activity with their respective fragment and what I want to do is move from a fragment to an activity through a button. Thanks

    
asked by kevvelas 24.11.2017 в 07:46
source

1 answer

1

You just have to do this:

boton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {


                Intent intent = new Intent(getActivity(),tu_actividad.class);
                startActivity(intent);
            }
        });

REMEMBER THAT TO LINK YOUR CONTROLS IN onCreateView IS ASI:

     View view = (LinearLayout) inflater.inflate(R.layout.map_layout, container, false);
     BOTON1 = (Button) view.findViewById(R.id.boton); // aqui ahora usas el view primero y después find...

IT IS IMPORTANT THAT YOU NOTICE THE CHANGE OF THE VIEW. NOW YOU ALSO ADD YOUR SIGHT.

    
answered by 24.11.2017 / 08:39
source