java - ANDROID:android-parse 中的电子邮件客户端收件人电子邮件 ID 为空

标签 java android email parsing android-service

我在应用程序中使用 android- 解析服务器。下面是电子邮件列的解析数据库屏幕截图。 电子邮件列在数据库中隐藏的密码列之后。

parse database screenshot

我的问题是


当我为电子邮件客户端检索电子邮件 ID 时, email 为空,即使 email 列有 emails 。


注意:在另一个地方(另一个表)的应用程序中,我以相同的方式将电子邮件 ID 拉到电子邮件客户端,但邮件显示良好.. 只有在这里出现问题。

谁知道请帮忙?

this is email column in parse database

 try{
                        JSONObject jsonObject = parseObjectToJson(object);
                        Log.d("Object", jsonObject.toString());
                        Log.d("Email", "+" + object.get("email"));
                        personNumber = jsonObject.getString("telephone");
                        personEmail = jsonObject.getString("email");
                    }catch (JSONException je){

                    }catch (ParseException pe){

                    }

this is email button

  emailPerson = (Button)findViewById(R.id.individualEmail);
            emailPerson.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent i = new Intent(Intent.ACTION_SEND);
                    i.setData(Uri.parse("mailto:"));
                    i.setType("plain/text");
                    i.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] {personEmail});
                    startActivity(i);
                }
            });
            if(personEmail==null || personEmail.equals("")  || personEmail.equals(" ")){
                emailPerson.setClickable(false);
                emailPerson.setEnabled(false);
                emailPerson.setVisibility(View.GONE);
            }
            else{
                emailPerson.setEnabled(true);
                emailPerson.setClickable(true);
                emailPerson.setVisibility(View.VISIBLE);
            }

here it is working fine but this is a different table in same database . >in this table there is no hidden password field

try{
                            corporateEmail = jsonObject.getString("email");
                            if(corporateEmail == null || corporateEmail.equals("")){
                                emailCorporate.setVisibility(View.GONE);
                                emailCorporate.setEnabled(false);
                                emailCorporate.setClickable(false);
                            }

emailCorporate = (Button) findViewById(R.id.corporateEmail);
        emailCorporate.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(Intent.ACTION_SEND);
                i.setData(Uri.parse("mailto:"));
                i.setType("plain/text");
                i.putExtra(Intent.EXTRA_EMAIL, new String[] {corporateEmail});
                startActivity(i);
            }
        });

 private JSONObject parseObjectToJson(ParseObject parseObject) throws ParseException, JSONException, com.parse.ParseException {
        JSONObject jsonObject = new JSONObject();
        parseObject.fetchIfNeeded();
        Set<String> keys = parseObject.keySet();
        for (String key : keys) {
            Object objectValue = parseObject.get(key);
            if (objectValue instanceof ParseObject) {
                jsonObject.put(key, parseObjectToJson(parseObject.getParseObject(key)));
            } else if (objectValue instanceof ParseRelation) {
            } else {
                jsonObject.put(key, objectValue.toString());
            }
        }
        return jsonObject;
    }

最佳答案

如果 jsonObject 不为空,请检查您从中提取数据的解析数据库是否具有“电子邮件”标签

关于java - ANDROID:android-parse 中的电子邮件客户端收件人电子邮件 ID 为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42968587/

相关文章:

android - "IMPACT LEVEL CHANGED FROM 2 TO 3"是什么意思?影响级别 2 和级别 3 之间有什么区别?

java - 如何使用 for 循环 Spring Mvc 对父对象中的对象列表进行排序

android - 如何使用 Android PowerProfile 私有(private) API?

java - 如何配置 log4j 以忽略层次结构记录器

android - 如何在 android 中获取 WEEK_OF_YEAR 内的日期列表?

php - 如何通过 CodeIgniter 以联系方式成功发送电子邮件?

Python smtplib仅发送消息正文

java - 使用Java群发多封邮件

java - 关于esper引擎的示例代码

java泛型和集合赋值