title: Attempt to invoke virtual method 'android.content.Context android.support.v4.app.FragmentActivity.getApplicationContext()' android
body: <p>I have some problem when I set RecyclerViewAdapter</p>
  
  <p>I get error</p>
  
  <blockquote>
    <p>java.lang.NullPointerException: Attempt to invoke virtual method
    'android.content.Context
    android.support.v4.app.FragmentActivity.getApplicationContext()' on a
    null object reference</p>
  </blockquote>
  
  <p>in line <code>mLayoutManager = new LinearLayoutManager(getActivity().getApplicationContext());</code></p>
  
  <p>How to fix it</p>
  
  <pre><code>for (ProfileFeedListModelTwo.PostBean.PollBean pollBean : pp){
     pollBeanArrayList.add(pollBean);}
  
   adapDetailTopicPoll = new AdapDetailTopicPoll(pollBeanArrayList,getContext());
              mLayoutManager = new LinearLayoutManager(getActivity().getApplicationContext());
              recyclerView.setLayoutManager(mLayoutManager);
              recyclerView.setItemAnimator(new DefaultItemAnimator());
              recyclerView.setAdapter(adapDetailTopicPoll);
  </code></pre>