Back to project page Android-Parse.com-Simple-Login-and-Signup-Tutorial.
The source code is released under:
Apache License
If you think the Android project Android-Parse.com-Simple-Login-and-Signup-Tutorial listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.androidbegin.parselogintutorial; //from ww w . j a va2 s.c om import android.app.Activity; import android.content.Intent; import android.os.Bundle; import com.parse.ParseAnonymousUtils; import com.parse.ParseUser; public class MainActivity extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Determine whether the current user is an anonymous user if (ParseAnonymousUtils.isLinked(ParseUser.getCurrentUser())) { // If user is anonymous, send the user to LoginSignupActivity.class Intent intent = new Intent(MainActivity.this, LoginSignupActivity.class); startActivity(intent); finish(); } else { // If current user is NOT anonymous user // Get current user data from Parse.com ParseUser currentUser = ParseUser.getCurrentUser(); if (currentUser != null) { // Send logged in users to Welcome.class Intent intent = new Intent(MainActivity.this, Welcome.class); startActivity(intent); finish(); } else { // Send user to LoginSignupActivity.class Intent intent = new Intent(MainActivity.this, LoginSignupActivity.class); startActivity(intent); finish(); } } } }