Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/341.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/202.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在ANDROID上实现忘记密码时出错_Java_Android_Eclipse - Fatal编程技术网

Java 在ANDROID上实现忘记密码时出错

Java 在ANDROID上实现忘记密码时出错,java,android,eclipse,Java,Android,Eclipse,我试图使用php文件在我的应用程序中实现忘记密码功能,但遇到了一些错误。我向用户索要他们的电子邮件,然后将它们存储在params中,这样我的php文件就可以抓取电子邮件并发送给他们 下面是我的代码: btnPasswordSubmit.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // new ForgotPassword().execute()

我试图使用php文件在我的应用程序中实现忘记密码功能,但遇到了一些错误。我向用户索要他们的电子邮件,然后将它们存储在params中,这样我的php文件就可以抓取电子邮件并发送给他们

下面是我的代码:

btnPasswordSubmit.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            // new ForgotPassword().execute();
            String recoveryPassword = txtRecoveryPassword.getText()
                    .toString();

            // Building Parameters
            List<NameValuePair> params = new ArrayList<NameValuePair>();
            params.add(new BasicNameValuePair("email", recoveryPassword));
            // getting JSON Object
            // Note that create event URL accepts POST method
            JSONObject json = jsonParser.makeHttpRequest(
                    forgotPassword_url, "POST", params);

            // check log cat for response
            Log.d("Create Response", json.toString());

            // check for success tag
            try {
                int success = json.getInt(TAG_SUCCESS);

                if (success == 1) {
                    // successfully email sent
                    Intent intent = new Intent(getApplicationContext(),
                            ForgotPasswordSuccessActivity.class);
                    startActivity(intent);
                    finish();
                } else {
                    // failed to create event
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
    });

你是用一个空字符串来测试这个吗?根据logcat中的这一行:

08-22 16:32:58.904: E/JSON Parser(271): Error parsing data org.json.JSONException: End of input at character 0 of 

它似乎试图解析空字符串,但失败了。

ForgotPasswordActivity上的内容。java:57?@jones ch Astor的意思是,尝试在调试模式(而不是运行模式)下运行,调试器将在导致问题的行上暂停,并让您检查变量的所有值,以查看导致问题的原因。@raghasood第57行是//请注意,创建事件URL接受POST方法。jsonParse、forgotPassword\u URL或params都为null。使用调试找出哪一个。
08-22 16:32:58.904: E/JSON Parser(271): Error parsing data org.json.JSONException: End of input at character 0 of