android - 如何在android中使用Parse实现忘记密码?

标签 android

这是我的代码,但它给我错误方法未找到:

Map<String, String> params = new HashMap<>();
params.put("text", "Your password is: "+"12345678");
params.put("subject", "ForgotPassword");
params.put("fromEmail", "ecalculatorapp@gmail.com");
params.put("fromName", "ECalculator Team");
params.put("toEmail", emailAddress);

ParseCloud.callFunctionInBackground("sendMail", params, new FunctionCallback<Object>() {
    @Override
    public void done(Object response, ParseException exc) {
        Log.e("cloud code example", "response: " + response);
    }
});

提前致谢!

最佳答案

public void showForgetPassword() {
        final Dialog dialog=new Dialog(context);
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        dialog.setCanceledOnTouchOutside(false);
        dialog.setContentView(R.layout.dialog_forget_password);

       final EditText edt_ForgotPassword=(EditText)dialog.findViewById(R.id.edt_ForgotPassword);


        dialog.findViewById(R.id.btn_OK).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                String email = edt_ForgotPassword.getText().toString().trim();

                if(email.equalsIgnoreCase("")){
                    edt_ForgotPassword.setError(context.getResources().getString(R.string.emailError));
                }else if (!isValidEmail(email)) {
                    edt_ForgotPassword.setError(context.getResources().getString(R.string.invalidEmail));
                }else{
                    List<NameValuePair> params = new ArrayList<NameValuePair>();
                    params.add(new BasicNameValuePair("email", email));

                    String serverURL = ServerUrl.serverForgotPassword;
                    if(!cd.isConnectingToInternet()){
                        dialogs.showNetworkDialog(context.getResources().getString(R.string.internet));
                    }else{
                         if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB){
                             getJSON = new GetJSON(context,params,serverURL);
                             getJSON.registerListener(CommonDialog.this);
                             getJSON.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
                         }else{
                             getJSON = new GetJSON(context,params,serverURL);
                             getJSON.registerListener(CommonDialog.this);
                             getJSON.execute();
                         }
                    }
                    dialog.dismiss();
                }
            }
        });

        dialog.findViewById(R.id.btn_Cancel).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
            }
        });

           //::::::::::::::font function:::::::::::::::::::::::::::::::::::::::::::::::::::: 
            ViewGroup root = (ViewGroup)dialog.findViewById(R.id.rl_DialogCommon);
            fontType=new FontType(context,root);

            dialog.show();
    }

关于android - 如何在android中使用Parse实现忘记密码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34355429/

相关文章:

android - 如何从 TextToSpeech 引擎创建的合成语音中获取音频 byte[]?

android - 在调试期间防止 ApplicationNotResponding

java - 如何使用自定义 Recycler 适配器创建封闭的循环 Recyclerview?

java - Android如何获取音频文件持续时间

android - 不要在 DatePicker 中接受过去的日期

java - 如何识别随机ID并将其称为 child ?

android - Kotlin 上限 : What difference does `:Any` make to Kotlin's generic type inference?

android - 在 android 上的 opencv 中创建 yuv mat

android - 简单的 Facebook Android SDK : How to like a Page

Android NullPointerException 第二次在 Runnable 中