title: Windows leak error
body: <p>I have this login Activity that contains async task class which perform a parsing method(Post) everything is going right and my data is posted but when the user enters a wrong email and password i just need to Toast him that his email and password are wrong so my code look like this:</p>
  
  <pre><code>public class ActivityLogin extends Activity 
  {
  // Progress Dialog
      private ProgressDialog pDialog;
      private static String login_tag = "login";
      PostParser jsonParser = new PostParser();
      // UI references.
      private EditText email;
      private EditText password;
      static String Email="";
      static String Password="";
      // url to create new product
      private static String login_URL = "jhdakjhdakj";
      // JSON Node names
      private static final String TAG_SUCCESS = "success";
      @Override
      protected void onCreate(Bundle savedInstanceState) 
      {
  
          super.onCreate(savedInstanceState);
          //this.requestWindowFeature(Window.FEATURE_NO_TITLE);
  
          setContentView(R.layout.activity_login);
  
          email=(EditText)findViewById(R.id.email);
          password=(EditText)findViewById(R.id.password1);
  
          Button login=(Button)findViewById(R.id.sign_in_button);
          login.setOnClickListener(new View.OnClickListener() 
          {
  
              @Override
              public void onClick(View v) 
              {
                  // TODO Auto-generated method stub
                  Email=email.getText().toString();
                  Password=password.getText().toString();
                  (new LoginInTask()).execute();
  
              }
          });
  
  
      }
      class LoginInTask extends AsyncTask&lt;String, String, String&gt; {
  
          /**
           * Before starting background thread Show Progress Dialog
           * */
          @Override
          protected void onPreExecute() {
              super.onPreExecute();
              pDialog = new ProgressDialog(ActivityLogin.this);
              pDialog.setMessage("Logging IN..");
              pDialog.setIndeterminate(false);
              pDialog.setCancelable(true);
              pDialog.show();
          }
  
          /**
           * Creating product
           * */
          protected String doInBackground(String... args) 
      {
          String Email = email.getText().toString();
          String Password = password.getText().toString();
          // Building Parameters
          List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
          params.add(new BasicNameValuePair("tag", login_tag));
          params.add(new BasicNameValuePair("Email", Email));
          params.add(new BasicNameValuePair("Password", Password));
  
          // getting JSON Object
          // Note that create product url accepts POST method
          JSONObject json = jsonParser.makeHttpRequest(login_URL,"POST", params);
  
  
          // check log cat fro response
          Log.d("Create Response", json.toString());
  
          // check for success tag
  
              int success=0;
              try 
              {
                  success = json.getInt(TAG_SUCCESS);
              } catch (JSONException e) 
              {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
  
  
          return null;
      }
      /**
       * After completing background task Dismiss the progress dialog
       * **/
      protected void onPostExecute(int success) 
      {
          if (success==1) 
          {   
              // successfully created product
              Intent i = new Intent(getApplicationContext(), ActivitySignUp.class);
              startActivity(i);
  
              // closing this screen
              pDialog.dismiss();
              finish();
          }
          else 
          {                   
  
                Toast.makeText(getApplicationContext(), "Failed", Toast.LENGTH_SHORT).show();
  
          }
          pDialog.dismiss();
          finish();
      }
  
  }
  }
  </code></pre>
  
  <p>your help would be appreciated. Thank you</p>
  
  <p>here is my logcat</p>
  
  <pre><code> 11-05 16:16:46.536: E/AndroidRuntime(5807): FATAL EXCEPTION: AsyncTask #1
   11-05 16:16:46.536: E/AndroidRuntime(5807): java.lang.RuntimeException: An error occured while   executing doInBackground()
   11-05 16:16:46.536: E/AndroidRuntime(5807):    at android.os.AsyncTask$3.done(AsyncTask.java:299)
   11-05 16:16:46.536: E/AndroidRuntime(5807):    at   java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
   11-05 16:16:46.536: E/AndroidRuntime(5807):    at   java.util.concurrent.FutureTask.setException(FutureTask.java:219)
   11-05 16:16:46.536: E/AndroidRuntime(5807):    at  java.util.concurrent.FutureTask.run(FutureTask.java:239)
   11-05 16:16:46.536: E/AndroidRuntime(5807):    at  android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
   11-05 16:16:46.536: E/AndroidRuntime(5807):    at  java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
   11-05 16:16:46.536: E/AndroidRuntime(5807):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
   11-05 16:16:46.536: E/AndroidRuntime(5807):    at java.lang.Thread.run(Thread.java:849)
   11-05 16:16:46.536: E/AndroidRuntime(5807): Caused by: java.lang.NullPointerException
   11-05 16:16:46.536: E/AndroidRuntime(5807):    at  com.asap.ActivityLogin$LoginInTask.doInBackground(ActivityLogin.java:108)
   11-05 16:16:46.536: E/AndroidRuntime(5807):    at com.asap.ActivityLogin$LoginInTask.doInBackground(ActivityLogin.java:1)
   11-05 16:16:46.536: E/AndroidRuntime(5807):    at android.os.AsyncTask$2.call(AsyncTask.java:287)
   11-05 16:16:46.536: E/AndroidRuntime(5807):    at java.util.concurrent.FutureTask.run(FutureTask.java:234)
   11-05 16:16:46.536: E/AndroidRuntime(5807):    ... 4 more
  </code></pre>