I am new to the use of Fragments, and I have a doubt, I do not know why when I click on a button, I do not open the Fragment that I invoke .. I already look for several solutions but I continue with the same thing, I thunders here I leave the code ...
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
view = inflater.inflate(R.layout.fragment_fragment_entidades, container, false);
btnInge = (Button) view.findViewById(R.id.btnIngenieria);
btnInge.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Fragment fragment = new FragmentIngenieria();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.replace(R.id.content_main,fragment);
transaction.commit();
}
});