title: android.support.v7.widget.AppCompatButton cannot be cast to android.view.ViewGroup
body: <p>i m replacing my fragment through onclick button but getting this error plz help
  this is my detail activity fragment </p>
  
  <pre><code>public class DetailActivityFragment extends Fragment{
  
      TextView textView;
      ImageView imageView;
      TextView details;
      Button button;
      public DetailActivityFragment() {
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          View view=inflater.inflate(R.layout.fragment_detail, container, false);
  
  
         Bundle getBundle = getActivity().getIntent().getExtras();
  
          String name = getBundle.getString("NAME");
          textView= (TextView) view.findViewById(R.id.bioname);
          textView.setText(name);
          imageView= (ImageView) view.findViewById(R.id.imageView);
          imageView.setImageResource(getBundle.getInt("IMAGE"));
          Log.v("test", "images are coming");
           button= (Button) view.findViewById(R.id.quickfacts);
          button.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Fragment fragment = new QuickFacts();
                  FragmentTransaction fragmentTransaction =
                          getFragmentManager().beginTransaction();
  
                  fragmentTransaction.replace(R.id.quickfacts, fragment);
                  fragmentTransaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
                  fragmentTransaction.addToBackStack(null);
                  fragmentTransaction.commit();
              }
          });
          return view;
      }
  }
  </code></pre>
  
  <p>this is my qucikfacts.xml  which is a part of quickfact fragment on which fragmeht is replacing on click</p>
  
  <pre><code>&lt;FrameLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/quickfacts"
      &gt;&lt;/FrameLayout&gt;
  &lt;!-- TODO: Update blank fragment layout --&gt;
  &lt;TextView
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:text="@string/hello_blank_fragment" /&gt;
  </code></pre>
  
  <p>this is my fragment detail in which i have that button 
       </p>
  
  <pre><code>&lt;ImageButton
      android:layout_width="150dp"
      android:layout_height="250dp"
      android:scaleType="centerCrop"
      android:id="@+id/imageView"
      android:layout_marginLeft="10dp"
      android:layout_marginRight="10dp"
      android:layout_centerHorizontal="true"
      android:layout_below="@+id/bioname" /&gt;
  
  &lt;Button
      android:id="@+id/quickfacts"
  
      android:text="Quick Facts"
      android:textColor="#FFFFFF"
      android:textSize="25sp"
  
      android:layout_width="150dp"
      android:layout_height="60dp"
      android:background="@drawable/quick_facts"
      android:shadowColor="#A8A8A8"
      android:shadowDx="0"
      android:shadowDy="0"
      android:shadowRadius="5"
      android:layout_below="@+id/imageView"
      android:layout_alignParentStart="true" /&gt;
  &lt;Button
      android:id="@+id/biodetail"
  
      android:text="Biography"
      android:textColor="#FFFFFF"
      android:textSize="25sp"
  
      android:layout_width="150dp"
      android:layout_height="60dp"
      android:background="@drawable/quick_facts"
      android:shadowColor="#A8A8A8"
      android:shadowDx="0"
      android:shadowDy="0"
      android:shadowRadius="5"
      android:layout_below="@+id/imageView"
      android:layout_alignParentEnd="true" /&gt;
  &lt;Button
      android:id="@+id/exit"
  
      android:text="Exit"
      android:textColor="#FFFFFF"
      android:textSize="25sp"
  
      android:layout_width="150dp"
      android:layout_height="60dp"
      android:background="@drawable/quick_facts"
      android:shadowColor="#A8A8A8"
      android:shadowDx="0"
      android:shadowDy="0"
      android:shadowRadius="5"
      android:layout_alignTop="@+id/quotes"
      android:layout_alignStart="@+id/biodetail"
      android:layout_alignParentEnd="true" /&gt;
  
  &lt;Button
      android:id="@+id/quotes"
  
      android:text="Quotes"
      android:textColor="#FFFFFF"
      android:textSize="25sp"
  
      android:layout_width="150dp"
      android:layout_height="60dp"
      android:background="@drawable/quick_facts"
      android:shadowColor="#A8A8A8"
      android:shadowDx="0"
      android:shadowDy="0"
      android:shadowRadius="5"
      android:layout_below="@+id/quickfacts"
      android:layout_alignParentStart="true"
      android:layout_marginTop="43dp" /&gt;
  </code></pre>
  
  <p>this is the logcat</p>
  
  <pre><code> FATAL EXCEPTION: main
                                                                                     Process: com.example.rahul.famousbiography, PID: 723
                                                                             java.lang.ClassCastException: android.support.v7.widget.AppCompatButton cannot be cast to android.view.ViewGroup
                                                                                 at android.support.v4.app.BackStackRecord.configureTransitions(BackStackRecord.java:1132)
                                                                                 at android.support.v4.app.BackStackRecord.beginTransition(BackStackRecord.java:1039)
                                                                                 at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:658)
                                                                                 at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1613)
                                                                                 at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517)
                                                                                 at android.os.Handler.handleCallback(Handler.java:739)
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                 at android.os.Looper.loop(Looper.java:135)
                                                                                 at android.app.ActivityThread.main(ActivityThread.java:5254)
                                                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                                                 at java.lang.reflect.Method.invoke(Method.java:372)
                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
                                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
  </code></pre>