title: Why is my context in my Fragment null?
body: <p>I have got a question regarding the usage of context in a fragment. My problem is that I always get a NullpointerException. Here is what i do:</p>
  
  <p>Create a class that extends the SherlockFragment. In that class I have an instance of another Helper class:</p>
  
  <pre><code>public class Fragment extends SherlockFragment { 
      private Helper helper = new Helper(this.getActivity());
  
      // More code ...
  }
  </code></pre>
  
  <p>Here is an extract of the other Helper class:</p>
  
  <pre><code>public class Helper {
      public Helper(Context context) {
          this.context = context;
      }
      // More code ...
  }
  </code></pre>
  
  <p>Everytime I call <code>context.someMethod</code> (e.g. context.getResources() ) I get a NullPointerException. Why is that?</p>