本文整理汇总了Java中com.parse.RequestPasswordResetCallback类的典型用法代码示例。如果您正苦于以下问题:Java RequestPasswordResetCallback类的具体用法?Java RequestPasswordResetCallback怎么用?Java RequestPasswordResetCallback使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RequestPasswordResetCallback类属于com.parse包,在下文中一共展示了RequestPasswordResetCallback类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resetPassword
import com.parse.RequestPasswordResetCallback; //导入依赖的package包/类
private void resetPassword() {
ParseUser.requestPasswordResetInBackground(getEmailAddress(), new RequestPasswordResetCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
Toast.makeText(LoginActivity.this, R.string.password_reset_email_sent, Toast.LENGTH_SHORT).show();
mResetPasswordInitialised = false;
mLoginButton.setText(R.string.log_in);
mPasswordEditText.animate().setDuration(500).alpha(1);
} else {
mEmailEditText.setError(e.getMessage());
}
}
});
}
示例2: onClick
import com.parse.RequestPasswordResetCallback; //导入依赖的package包/类
@Override
public void onClick(View v) {
EditText email = emailReference.get();
String emailString = email.getText().toString();
boolean validEmail = InputValidator.validateEmail(emailString);
if (!validEmail) {
email.setError(context.getString(R.string.email_error));
} else {
// everything is ok
ProgressDialog progressDialog = ProgressDialog.show(context, "",
context.getString(R.string.resetting));
progressDialog.setCancelable(true);
RequestPasswordResetCallback callback = new MyResetPasswordCallback(
context, progressDialog);
ParseUser.requestPasswordResetInBackground(emailString, callback);
}
}
示例3: clickedReset
import com.parse.RequestPasswordResetCallback; //导入依赖的package包/类
/**
*/
public void clickedReset()
{
InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(mUsername.getWindowToken(), 0);
ParseUser.requestPasswordResetInBackground(mUsername.getText().toString(), new RequestPasswordResetCallback()
{
@Override
public void done(ParseException e)
{
Toast.makeText(mContext, "Please check your inbox for \"" +
mUsername.getText().toString() + "\"", Toast.LENGTH_LONG).show();
mDialog.dismiss();
}
});
}
示例4: resetPassword
import com.parse.RequestPasswordResetCallback; //导入依赖的package包/类
public void resetPassword(View view) {
if (!this.validateForm()) {
return;
}
String email = this.getEmail();
this.turnOnProgressDialog("Reset Password", "Wait while we send you email with password reset");
ParseUser.requestPasswordResetInBackground(email, new RequestPasswordResetCallback() {
@Override
public void done(ParseException e) {
turnOffProgressDialog();
if (e == null) {
reportSuccessfulReset();
} else {
reportResetError(e);
}
}
});
}
示例5: resetPassword
import com.parse.RequestPasswordResetCallback; //导入依赖的package包/类
public void resetPassword(View v)
{
if (validateForm() == false){
return;
}
String sEmail = email.getText().toString();
turnOnProgressDialog("Reset Password","Wait while we send you email with password reset");
//userid is there
ParseUser.requestPasswordResetInBackground(sEmail,
new RequestPasswordResetCallback() {
public void done(ParseException e) {
turnOffProgressDialog();
if (e == null) {
reportSuccessfulReset();
} else {
reportResetError(e);
}
}
});
}
示例6: onClick
import com.parse.RequestPasswordResetCallback; //导入依赖的package包/类
@Override
public void onClick(View v) {
if(!validate()) {
return;
}
if (!emailSent) {
loadingStart();
ParseUser.requestPasswordResetInBackground(emailField.getText().toString(),
new RequestPasswordResetCallback() {
@Override
public void done(ParseException e) {
if (isActivityDestroyed()) {
return;
}
loadingFinish();
if (e == null) {
instructionsTextView.setText(R.string.helpSuccess);
emailField.setVisibility(View.INVISIBLE);
submitButton.setText(R.string.helpBackToLogin);
emailSent = true;
} else {
if (e.getCode() == ParseException.INVALID_EMAIL_ADDRESS ||
e.getCode() == ParseException.EMAIL_NOT_FOUND) {
showToast(R.string.invalidEmail);
} else {
showToast(R.string.unknownHelpError);
}
}
}
});
} else {
onLoginHelpSuccessListener.onLoginHelpSuccess();
}
}
示例7: initForgotPass
import com.parse.RequestPasswordResetCallback; //导入依赖的package包/类
public void initForgotPass(final View v) {
if (mEmailField.getText().length() == 0) {
mErrorField.setText("Please enter a valid email address.");
return;
}
v.setEnabled(false);
spinner.setVisibility(View.VISIBLE);
mErrorField.setText("");
InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
mgr.hideSoftInputFromWindow(mEmailField.getWindowToken(), 0);
ParseUser.requestPasswordResetInBackground(mEmailField.getText().toString(), new RequestPasswordResetCallback() {
public void done(ParseException e) {
if (e == null) {
spinner.setVisibility(View.GONE);
Toast.makeText(ForgotPassActivity.this, "Password reset instructions sent!",
Toast.LENGTH_LONG).show();
Intent intent = new Intent(ForgotPassActivity.this,
LoginActivity.class);
startActivity(intent);
finish();
// An email was successfully sent with reset instructions.
} else {
v.setEnabled(true);
spinner.setVisibility(View.GONE);
mErrorField.setText("Sorry, password reset failed. Please try again.");
}
}
});
}
示例8: sentPassword
import com.parse.RequestPasswordResetCallback; //导入依赖的package包/类
public void sentPassword(String email) {
ParseUser.requestPasswordResetInBackground(email, new RequestPasswordResetCallback() {
public void done(ParseException e) {
if (e == null) {
handler.sendEmptyMessage(CONNECTION_OK);
} else {
handler.sendEmptyMessage(0);
}
}
});
}
示例9: onClick
import com.parse.RequestPasswordResetCallback; //导入依赖的package包/类
@Override
public void onClick(View v) {
if (!emailSent) {
String email = emailField.getText().toString();
if (email.length() == 0) {
showToast(R.string.com_parse_ui_no_email_toast);
} else {
loadingStart();
ParseUser.requestPasswordResetInBackground(email,
new RequestPasswordResetCallback() {
@Override
public void done(ParseException e) {
if (isActivityDestroyed()) {
return;
}
loadingFinish();
if (e == null) {
instructionsTextView
.setText(R.string.com_parse_ui_login_help_email_sent);
emailField.setVisibility(View.INVISIBLE);
submitButton
.setText(R.string.com_parse_ui_login_help_login_again_button_label);
emailSent = true;
} else {
debugLog(getString(R.string.com_parse_ui_login_warning_password_reset_failed) +
e.toString());
if (e.getCode() == ParseException.INVALID_EMAIL_ADDRESS ||
e.getCode() == ParseException.EMAIL_NOT_FOUND) {
showToast(R.string.com_parse_ui_invalid_email_toast);
} else {
showToast(R.string.com_parse_ui_login_help_submit_failed_unknown);
}
}
}
});
}
} else {
onLoginHelpSuccessListener.onLoginHelpSuccess();
}
}