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
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
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.