title: How to open a new view from a Fragment?
body: <p>I have a fragment with a list of lessons:</p>
  
  <p><a href="https://i.stack.imgur.com/5okjr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5okjr.png" alt="enter image description here"></a></p>
  
  <p>I want when I click the first option to open a new view.
  How I can do that?</p>
  
  <p>Below is the code from the fragment in the image</p>
  
  <pre><code>public class FirstYearFragment extends Fragment {  
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          final View rootView = inflater.inflate(R.layout.word_list, container, false);
  
          // Create a list of words
          final ArrayList&lt;Word&gt; words = new ArrayList&lt;Word&gt;();
          words.add(new Word(R.string.firstYearDirection, R.string.algevra, R.drawable.algevra));
          words.add(new Word(R.string.firstYearDirection, R.string.arxaia, R.drawable.arxaia));
          words.add(new Word(R.string.firstYearDirection, R.string.ekuesi, R.drawable.ekthesi));
          words.add(new Word(R.string.firstYearDirection, R.string.geometria, R.drawable.geometry));
          words.add(new Word(R.string.firstYearDirection, R.string.fysiki, R.drawable.fusiki));
          words.add(new Word(R.string.firstYearDirection, R.string.xhmeia, R.drawable.xhmeia));
  
          // Create an {@link WordAdapter}, whose data source is a list of {@link Word}s. The
          // adapter knows how to create list items for each item in the list.
          WordAdapter adapter = new WordAdapter(getActivity(), words, R.color.category_first_year);
  
          // Find the {@link ListView} object in the view hierarchy of the {@link Activity}.
          // There should be a {@link ListView} with the view ID called list, which is declared in the
         // word_list.xml layout file.
         ListView listView = (ListView) rootView.findViewById(R.id.list);
  
          // Make the {@link ListView} use the {@link WordAdapter} we created above, so that the
          // {@link ListView} will display list items for each {@link Word} in the list.
          listView.setAdapter(adapter);
  
          return rootView;
  
      }
  }
  </code></pre>