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 va 2s.co m*/ import com.parse.ParseUser; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; public class Welcome extends Activity { // Declare Variable Button logout; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Get the view from singleitemview.xml setContentView(R.layout.welcome); // Retrieve current user from Parse.com ParseUser currentUser = ParseUser.getCurrentUser(); // Convert currentUser into String String struser = currentUser.getUsername().toString(); // Locate TextView in welcome.xml TextView txtuser = (TextView) findViewById(R.id.txtuser); // Set the currentUser String into TextView txtuser.setText("You are logged in as " + struser); // Locate Button in welcome.xml logout = (Button) findViewById(R.id.logout); // Logout Button Click Listener logout.setOnClickListener(new OnClickListener() { public void onClick(View arg0) { // Logout current user ParseUser.logOut(); finish(); } }); } }