Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class LoginActivity extends ActionBarActivity {
- Button loginButton;
- String txtUsername;
- String txtPassword;
- EditText password;
- EditText username;
- @Override
- protected void onCreate(Bundle saveInstanceState) {
- super.onCreate(saveInstanceState);
- setContentView(R.layout.activity_login);
- loginButton = (Button) findViewById(R.id.login);
- loginButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- txtUsername = username.getText().toString();
- txtPassword = password.getText().toString();
- ParseUser.logInInBackground(txtUsername, txtPassword, new LogInCallback() {
- @Override
- public void done(ParseUser user, ParseException e) {
- if (user != null) {
- Intent intent = new Intent(LoginActivity.this, Welcome.class);
- startActivity(intent);
- finish();
- } else {
- Toast.makeText(getApplicationContext(), "This user does not exist! Please Sign up", Toast.LENGTH_SHORT).show();
- }
- }
- });
- }
- });
- }
- public class ParseConnector extends MultiDexApplication {
- @Override
- public void onCreate(){
- super.onCreate();
- Parse.initialize(this, "ZzfoJHON4Gc******2YlIhOFT3Tk8GOoANeO", "9ikHKNBO6BfmNRMauxckoB******ZzxlBPYDL");
- ParseInstallation.getCurrentInstallation().saveInBackground();
- ParseUser.enableAutomaticUser();
- ParseACL defaultACL = new ParseACL();
- defaultACL.setPublicReadAccess(true);
- ParseACL.setDefaultACL(defaultACL, true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement