title: Layout inflater is null
body: <p>Can someone help me? 
  I don't know why have I javaNullExepction in LayoutInflater.Here is my code :</p>
  
  <p>This code is in fragment :</p>
  
  <pre><code>ServiceManager.getInstance().getCampaign( new Callback &lt;Campaign&gt;() {
              @Override
              public void success(Campaign campaign, Response response) {
                  campaigns = campaign;
                  adapter = new RecyclerCampaignAdapter(getActivity(), campaign);
                  recyclerView.setAdapter(adapter);
                  recyclerView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(getActivity()).marginProvider(adapter).showLastDivider().build());
                  adapter.notifyDataSetChanged();
                  if (progressBar.isShown()) {
                      progressBar.setVisibility(View.INVISIBLE);
                  }
              }
  
              @Override
              public void failure(RetrofitError retrofitError) {
                  Toast.makeText(getActivity(), "Failed" + retrofitError, Toast.LENGTH_SHORT).show();
                  progressBar.setVisibility(View.GONE);
              }
          });
  </code></pre>
  
  <p>here is code in my adapter :</p>
  
  <pre><code> public RecyclerCampaignAdapter (Activity activity, Campaign campaignList) {
          this.activity = activity;
          this.campaignList = campaignList;
          this.inflater= LayoutInflater.from(activity);
      }
  </code></pre>
  
  <p>I think <code>getActivity() == null</code> I don't know how can I fix it. </p>
  
  <blockquote>
    <p>java.lang.NullPointerException
                at android.view.LayoutInflater.from(LayoutInflater.java:212)
                at tr.org.yyd.yeryuzudoktorlari.adapter.RecyclerCampaignAdapter.(RecyclerCampaignAdapter.java:38)
                at tr.org.yyd.yeryuzudoktorlari.fragment.CampaignFragment$1.success(CampaignFragment.java:69)
                at tr.org.yyd.yeryuzudoktorlari.fragment.CampaignFragment$1.success(CampaignFragment.java:65)
                at retrofit.CallbackRunnable$1.run(CallbackRunnable.java:45)
                at android.os.Handler.handleCallback(Handler.java:733)
                at android.os.Handler.dispatchMessage(Handler.java:95)
                at android.os.Looper.loop(Looper.java:146)
                at android.app.ActivityThread.main(ActivityThread.java:5756)
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:515)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
                at dalvik.system.NativeStart.main(Native Method)</p>
  </blockquote>
  
  <p><strong>EDIT:</strong>
  I use replace method on frgment transaction when user clicks on an item from menu.So CampaignFragment works okey when the user clicks in first time but it crashes when user clicks again while it is still on.
  If I change into another fragment and come back to CampaginFragment there is no crash.</p>