title: Can't run new activity from onPostExecute
body: <p>I'm having trouble starting my mainActivity after I have gotten a response from a httpUrlConnection. 
  Here is my onPostExecute method</p>
  
  <pre><code>    protected void onPostExecute(String[] result) {
          serv.httphelper.handleResults(result);
  
      }
  </code></pre>
  
  <p>In the method handleResult() im handling the response code. If the response code is 200 i want to run a new method inside my loginActivity class</p>
  
  <pre><code>public void handleResults(String[] result) {
  
      status = result[0].toString();
      instructions = result[1].toString();
      jsonString = result[2];
  
      Log.d("DEBUG", status);
  
      if (status.equals("200")) {
          serv.loginActivity.proceed();
  
      } else if (status.equals("400")) {
          serv.loginActivity.loginError();
  
      } else if (status.equals("401")) {
          serv.loginActivity.loginError();
  
      }
  
  }
  </code></pre>
  
  <p>When i try to start a new activity from the proceed() method i get a nullpointerexception</p>
  
  <pre><code>    public void proceed(){
      startActivity(new Intent (LoginActivity.this, MainActivity.class));
      Log.d("TEST", "Proceed success");
  
  
  }
  </code></pre>
  
  <p>My service class for anyone wondering:</p>
  
  <pre><code>public class Service {
  
  public static HttpHelper httphelper = new HttpHelper();
  public static HttpConnect conn = new HttpConnect();
  public static LoginActivity loginActivity = new LoginActivity();
  </code></pre>
  
  <p>}</p>
  
  <p>And here is my logCat:
  <img src="https://i.stack.imgur.com/L7Biw.png" alt="LogCat"></p>
  
  <p>Thanks in advance! </p>