0

I have this code below that basically is the Login process of my app, Why do i have null pointers? Have I implemented it correctly, I have tried to use static for AsyncTask to avoid any memoryleak.

Login.java

    if (handler.executeLog(username.trim(), password.trim())) {
        session.saveLogin(username, password);
        Toast.makeText(this, "Successfully Logged In", Toast.LENGTH_SHORT).show();
        Intent log = new Intent(this, MainActivity.class);
        startActivity(log);
        handler.close();
        finish();
Cœur
  • 37,241
  • 25
  • 195
  • 267
Micheal
  • 11
  • 4

1 Answers1

2
 pd = new ProgressDialog(context);

context is null.

You should init this value in the constructor.

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841