title: Android - NullPointerException from creating an adapter
body: <p>I am creating an array adapter for a list view,
  everything works ok, I have 2 fragments, and 2 buttons at the top of the action bar that changes between this 2 fragments.
  my problem is that I get crashes if I move too fast between those frags, when I open fragOne, switch to fragTwo, and then quickly move back to fragOne.. fragOne throws a NPE from the getActivity context..</p>
  
  <p>that's the line that crashes:</p>
  
  <pre><code>adapter = new MainFragmentDocumentAdapter(getActivity(), docsList, DocumentsFragment.this, page);
  </code></pre>
  
  <p>the log report :</p>
  
  <pre><code>E/AndroidRuntime﹕ FATAL EXCEPTION: main
  Process: com.bbb.app, PID: 17438
  java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.content.Context.getSystemService(java.lang.String)' on a null object reference
          at android.widget.ArrayAdapter.init(ArrayAdapter.java:310)
          at android.widget.ArrayAdapter.&lt;init&gt;(ArrayAdapter.java:104)
          at com.bbb.app.UI.adapters.MainFragmentDocumentAdapter.&lt;init&gt;(MainFragmentDocumentAdapter.java:51)
  </code></pre>
  
  <p>any idea how can I solve this issue?</p>