I have an activity that contains a fragment and a button outside of that fragment, I need to create an event that, by clicking on the button, replaces this fragment with another one. Here is a piece of code for you to see, the fragment " Fragment_Temas " gives me an error.
two.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View v) {
FragmentManager fragment_manager = getFragmentManager();
FragmentTransaction transaction = fragment_manager.beginTransaction();
transaction.replace( R.id.layout_fragment, Fragment_Temas);
transaction.commit();
}
} );