title: How to start activity from RecyclerView adapter in fragment
body: <p>I can't click <code>RecyclerView</code> to a new <code>Activity</code> from <code>RecyclerViewAdapter</code>.</p>
  
  <p>I call <code>ItemClick</code> here.</p>
  
  <p><strong>DayAdapter.java</strong>:</p>
  
  <pre><code>holder.setItemClickListener(new ItemClickListener() {
          @Override
          public void onClick(View view, int position, boolean isLongClick) {
              openProgramActivity(view, position);
          }
      });
  }
  </code></pre>
  
  <p>This function opens a new <code>Activity</code>:</p>
  
  <pre><code>public void openProgramActivity(View view, int position) {
      //Intent openProgramActivity = new Intent(context, ProgramActivity.class);
      Intent openProgramActivity = new Intent(view.getContext(), ProgramActivity.class);
      openProgramActivity.putExtra("index",position);
      view.getContext().startActivity(openProgramActivity);
  }
  </code></pre>
  
  <p><strong>FragmentDay30.java</strong>:</p>
  
  <pre><code>public class FragmentDay30 extends Fragment {
  
  private View view;
  
  public static FragmentDay30 newInstance() {
      FragmentDay30 fragment = new FragmentDay30();
      Bundle args = new Bundle();
      fragment.setArguments(args);
      return fragment;
  }
  
  @Override
  public void onCreate(@Nullable Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
  
      view = inflater.inflate(R.layout.fragment_30day, container,false);
  
      ViewPager slideViewPager = (ViewPager) view.findViewById(R.id.slideViewPager);
      SlideAdapter slideAdapter = new SlideAdapter(getActivity());
      slideViewPager.setAdapter(slideAdapter);
  
      RecyclerView fragment30datRecyclerView = (RecyclerView) view.findViewById(R.id.fragment30dayRecyclerView);
      LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity(),LinearLayoutManager.VERTICAL,false);
      fragment30datRecyclerView.setLayoutManager(linearLayoutManager);
      DayAdapter dayAdapter = new DayAdapter(getActivity());
      fragment30datRecyclerView.setAdapter(dayAdapter);
  
      return view;
  }
  </code></pre>
  
  <p>I try to use <code>getActvity()</code> and <code>getContext()</code> but not to new <code>Activity</code>.</p>