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

Fai*_*nna 7 java email parsing android android-service

我在app中使用android-parse服务器.下面是电子邮件列的解析db截图.电子邮件列位于数据库中的隐藏密码列之后.

解析数据库截图

我的问题是


当我检索电子邮件客户端的电子邮件ID时,即使电子邮件列有电子邮件,电子邮件也是空的.


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

如果有人知道请帮忙吗?

这是解析数据库中的电子邮件列

 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){

                    }
Run Code Online (Sandbox Code Playgroud)

这是电子邮件按钮

  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);
            }
Run Code Online (Sandbox Code Playgroud)

这里工作正常,但这是同一个数据库中的不同表.>在此表中没有隐藏密码字段

try{
                            corporateEmail = jsonObject.getString("email");
                            if(corporateEmail == null || corporateEmail.equals("")){
                                emailCorporate.setVisibility(View.GONE);
                                emailCorporate.setEnabled(false);
                                emailCorporate.setClickable(false);
                            }
Run Code Online (Sandbox Code Playgroud)
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);
            }
        });
Run Code Online (Sandbox Code Playgroud)
 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;
    }
Run Code Online (Sandbox Code Playgroud)

小智 2

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