title: Open fragment from activity?
body: <p>I wanna open fragment from my activity. The problem is that the fragment never appears.
  This is the part of my activity:</p>
  
  <pre><code> btn_opciones.setOnValueChangedListener(new ToggleButton.OnValueChangedListener() {
      @Override
      public void onValueChanged(int position) {
          if(position == 1){
              OrdenarComplejosFragment ordenarComplejosFragment = new OrdenarComplejosFragment();
              FragmentManager manager = getSupportFragmentManager();
              FragmentTransaction ft = manager.beginTransaction();
  
              ft.setCustomAnimations(R.anim.fade_in, R.anim.fade_out);
              ft.add(ordenarComplejosFragment, null);
              ft.commit();
          }
  
      }
  });
  </code></pre>
  
  <p>And this is my fragment that I wanna open and show:</p>
  
  <pre><code>public class OrdenarComplejosFragment extends Fragment {
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          return inflater.inflate(R.layout.fragment_ordenar_complejos, container, false);
      }
  
      @Override
      public void onViewCreated(View view, Bundle savedInstanceState) {
          super.onViewCreated(view, savedInstanceState);
          //do your stuff for your fragment here
      }
  }
  </code></pre>
  
  <p>The xml of the fragment above:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical" android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textAppearance="?android:attr/textAppearanceLarge"
          android:text="HOLAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
          android:id="@+id/textView35"
          android:layout_gravity="center_horizontal" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I don't know why the fragment never show. The button works fine.</p>