app/src/main/java/me/emmabr/parstagram/MainActivity.java
@Override
            public void done(ParseUser user, ParseException e) {
                if(e == null) {
                    Log.d("LoginActivity", "Login Successful!");
                    final Intent intent = new Intent(MainActivity.this, HomeActivity.class);
                    startActivity(intent);
                    // added so the user cannot log out by simply clicking the back button
                    finish();
                } else {
                    Log.e("LoginActivity", "Login failure");
                    Toast.makeText(MainActivity.this, "Invalid username/password", Toast.LENGTH_SHORT).show();
                    e.printStackTrace();
                }
            }
// login call back is added so we know when the network request is actually completed
login call back is added so we know when the network request is actually completed
login call back is added so we know when the network request is actually completed
@Override
            public void done(ParseUser user, ParseException e) {
                if(e == null) {
                    Log.d("LoginActivity", "Login Successful!");
                    final Intent intent = new Intent(MainActivity.this, HomeActivity.class);
                    startActivity(intent);
                    finish();
                } else {
                    Log.e("LoginActivity", "Login failure");
                    Toast.makeText(MainActivity.this, "Invalid username/password", Toast.LENGTH_SHORT).show();
                    e.printStackTrace();
                }
            }
@ Override public void done ( ParseUser user , ParseException e ) { if ( e == null ) { Log . d ( "LoginActivity" , "Login Successful!" ) ; final Intent intent = new Intent ( MainActivity . this , HomeActivity . class ) ; startActivity ( intent ) ; finish ( ) ; } else { Log . e ( "LoginActivity" , "Login failure" ) ; Toast . makeText ( MainActivity . this , "Invalid username/password" , Toast . LENGTH_SHORT ) . show ( ) ; e . printStackTrace ( ) ; } }
login call back is added so we know when the network request is actually completed
login call back is added so we know when the network request is actually completed
// added so the user cannot log out by simply clicking the back button