Search in sources :

Example 1 with AVMobilePhoneVerifyCallback

use of com.avos.avoscloud.AVMobilePhoneVerifyCallback in project ride-read-android by Ride-Read.

the class RegisterFragment method verifyCode.

//验证验证码
private void verifyCode() {
    EditText indentfyCodeEdt = (EditText) phoneNumView.findViewById(R.id.register_edt_identfycode);
    String code = indentfyCodeEdt.getText().toString().trim();
    if (!code.isEmpty()) {
        AVOSCloud.verifySMSCodeInBackground(code, telPhone, new AVMobilePhoneVerifyCallback() {

            @Override
            public void done(AVException e) {
                if (e == null) {
                    PreferenceUtils.getInstance().saveTelPhone(telPhone, getActivity().getApplicationContext());
                    changeView(phoneNumView, setPwdView);
                } else {
                    Log.e("----->>>>", e.getMessage());
                    e.printStackTrace();
                    Toast.makeText(getActivity(), "验证码不匹配", Toast.LENGTH_SHORT).show();
                }
            }
        });
    } else {
        Toast.makeText(getActivity(), "未填写验证码", Toast.LENGTH_SHORT).show();
    }
}
Also used : EditText(android.widget.EditText) AVException(com.avos.avoscloud.AVException) AVMobilePhoneVerifyCallback(com.avos.avoscloud.AVMobilePhoneVerifyCallback)

Example 2 with AVMobilePhoneVerifyCallback

use of com.avos.avoscloud.AVMobilePhoneVerifyCallback in project ride-read-android by Ride-Read.

the class LoginFragment method gotoFindPwd.

//跳转到找回密码
private void gotoFindPwd() {
    EditText indentfyCodeEdt = (EditText) findPwdView.findViewById(R.id.register_edt_identfycode);
    String code = indentfyCodeEdt.getText().toString().trim();
    Log.e("----->>>>", code + "," + telPhone);
    //startActivity(new Intent(FindPassword.this,RegisterSetPwdActivity.class));//下面的注释已经完成手机注册功能
    if (!code.isEmpty()) {
        AVOSCloud.verifySMSCodeInBackground(code, telPhone, new AVMobilePhoneVerifyCallback() {

            @Override
            public void done(AVException e) {
                if (e == null) {
                    //                                Intent intent=new Intent(FindPassword.this,ResetPassword.class);
                    //                                intent.putExtra("telPhone",telPhone);
                    //                                startActivity(intent);
                    changeView(findPwdView, reSetPwdView);
                } else {
                    Log.e("----->>>>", e.getMessage());
                    e.printStackTrace();
                    Toast.makeText(getActivity(), "验证码不匹配", Toast.LENGTH_SHORT).show();
                }
            }
        });
    } else {
        Toast.makeText(getActivity(), "未填写验证码", Toast.LENGTH_SHORT).show();
    }
}
Also used : EditText(android.widget.EditText) AVException(com.avos.avoscloud.AVException) AVMobilePhoneVerifyCallback(com.avos.avoscloud.AVMobilePhoneVerifyCallback)

Aggregations

EditText (android.widget.EditText)2 AVException (com.avos.avoscloud.AVException)2 AVMobilePhoneVerifyCallback (com.avos.avoscloud.AVMobilePhoneVerifyCallback)2