title: Can not cast android.app.fragment
body: <p>I've seen other posts, and they all suggest that the host activity java file is not extending android.support.v4.app.Fragment. However, I don't know how to make the hosting java file extend android.support.v4.app.Fragment. 
  I've tried adding the dependency to the gradle file but that doesn't work either.</p>
  
  <p>Here's the hosting activity snippet: </p>
  
  <pre><code>import android.app.Activity;
  import android.os.Bundle;
  import android.util.Log;
  import course.examples.fragmentstaticlayout.TitlesFragment.ListSelectionListener;
  
  public class QuoteViewerActivity extends Activity implements ListSelectionListener{
  
      public static String[] mTitleArray;
      public static String[] mQuoteArray;
      private QuotesFragment mDetailsFragment;
  
      private static final String TAG = "QuoteViewerActivity";
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          mTitleArray = getResources().getStringArray(R.array.Titles);
          mQuoteArray = getResources().getStringArray(R.array.Quotes);
  
          setContentView(R.layout.main);
  
          mDetailsFragment = (QuotesFragment) getFragmentManager().findFragmentById(R.id.details);
      }
  </code></pre>
  
  <p>The line in question is the last line of the snippet. And here is my QuotesFragment. </p>
  
  <pre><code>import android.content.Context;
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.TextView;
  
  public class QuotesFragment extends Fragment {
  
      private TextView mQuoteView = null;
      private int mCurrIdx = -1;
      private int mQuoteArrayLen;
  
      private static final String TAG = "QuotesFragment";
  
      public int getShownIndex() {
          return mCurrIdx;
      }
  
      public void showQuoteAtIndex(int newIndex) {
          if (newIndex &lt; 0 || newIndex &gt;= mQuoteArrayLen)
              return;
          mCurrIdx = newIndex;
          mQuoteView.setText(QuoteViewerActivity.mQuoteArray[mCurrIdx]);
      }
  
      @Override
      public void onAttach(Context context){
          Log.i(TAG, getClass().getSimpleName() + ":entered onAttach()");
  
          super.onAttach(context);
  
      }
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          Log.i(TAG, getClass().getSimpleName() + ":entered onCreate()");
          super.onCreate(savedInstanceState);
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          return inflater.inflate(R.layout.quote_fragment, container, false);
      }
  
      @Override
      public void onActivityCreated(Bundle savedInstanceState) {
          super.onActivityCreated(savedInstanceState);
          mQuoteView = (TextView) getActivity().findViewById(R.id.quoteView);
          mQuoteArrayLen = QuoteViewerActivity.mQuoteArray.length;
  
      }
  </code></pre>
  
  <p>Assuming that I'm right about the host activity not extending the support.v4, how would I do this?</p>