Back to project page Ribbit-Login-.
The source code is released under:
Eclipse Public License - v 1.0 THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECI...
If you think the Android project Ribbit-Login- 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.sabersoft.ribbit; /*from w w w . ja v a2 s . c o m*/ import com.parse.ParseException; import com.parse.ParseUser; import com.parse.RequestPasswordResetCallback; import android.app.Activity; import android.app.AlertDialog; import android.os.Bundle; import android.view.Menu; import android.view.View; import android.view.Window; import android.widget.Button; import android.widget.EditText; public class ForgotPasswordActivity extends Activity { protected EditText mEmailText; protected Button mSubmitButton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); setContentView(R.layout.activity_forgot_password); mEmailText = (EditText)findViewById(R.id.emailField2); mSubmitButton = (Button)findViewById(R.id.submitButton); mSubmitButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub String email = mEmailText.getText().toString(); email.trim(); if(email.isEmpty()) { AlertDialog.Builder builder = new AlertDialog.Builder(ForgotPasswordActivity.this); builder.setMessage(R.string.forgot_password_label) .setTitle(R.string.sign_up_error_title) .setPositiveButton(android.R.string.ok, null); AlertDialog dialog = builder.create(); dialog.show(); } else { setProgressBarIndeterminateVisibility(true); ParseUser.requestPasswordResetInBackground(email, new RequestPasswordResetCallback() { @Override public void done(ParseException e) { // TODO Auto-generated method stub setProgressBarIndeterminateVisibility(false); if (e == null) { AlertDialog.Builder builder = new AlertDialog.Builder(ForgotPasswordActivity.this); builder.setMessage("An email was sent. Please check your email within the next few minutes for more instructions") .setTitle("Success") .setPositiveButton(android.R.string.ok, null); AlertDialog dialog = builder.create(); dialog.show(); } else { AlertDialog.Builder builder = new AlertDialog.Builder(ForgotPasswordActivity.this); builder.setMessage(R.string.forgot_password_label) .setTitle(R.string.sign_up_error_title) .setPositiveButton(android.R.string.ok, null); AlertDialog dialog = builder.create(); dialog.show(); // Something went wrong. Look at the ParseException to see what's up. } } }); } } }); } }