我在我的Android应用程序中使用parse.com作为后端服务。现在我想在我的应用程序中添加密码重置功能,但它不起作用。当我执行点击时,它不会给我错误,也不会向我显示成功消息。我跟着parse.com的文档。帮帮我
这是我的代码。
public class ResetPassword extends AppCompatActivity {
TextView resetTv;
EditText resetEt;
Button resetButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_reset_password);
resetTv = (TextView)findViewById(R.id.tv_reset);
resetEt = (EditText)findViewById(R.id.etresetemail);
resetButton = (Button)findViewById(R.id.button_reset);
resetButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String email = resetEt.toString();
try{
ParseUser.requestPasswordResetInBackground(email, new RequestPasswordResetCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
resetTv.setText("An Email has been send to your email account! Follow the procedure");
} else {
Toast.makeText(getApplicationContext(), "Some Error! Try later" + e, Toast.LENGTH_LONG);
}
}
});
}
catch(Exception e){
Toast.makeText(getApplicationContext(),"Error"+e,Toast.LENGTH_LONG).show();
}
}
});
}