2015-10-18 136 views
0

空对象值时查询用户数据从数据库parse.com空对象值时查询用户数据从数据库parse.com

final ParseUser user= ParseUser.getCurrentUser(); 
    if (user!=null){ 
     Email.setText(user.getEmail()); 
     ParseFile file=user.getParseFile("ProfilePicture"); 
     file.getDataInBackground(new GetDataCallback() { 
      @Override 
      public void done(byte[] bytes, ParseException e) { 
       Bitmap pic= BitmapFactory.decodeByteArray(bytes, 0, bytes.length); 
       Bitmap croped=getCroppedBitmap(pic); 
       Bitmap scaled=Bitmap.createScaledBitmap(croped, 70, 70, true); 
       ProfilePicture.setImageBitmap(scaled); 

      } 
     }); 

    }else { 
     Toast.makeText(this,"Please Login",Toast.LENGTH_SHORT).show(); 
    } 

我的应用程序是仅示出位图图像,其中所获得的电子邮件值是使用log.d("Email:",user.getEmail()+"")空 代码中是否存在任何问题。

回答

0

听起来像用户没有输入电子邮件,或者用于保存电子邮件解析的代码不正确。检查Parse以查看该用户的数据库中是否存在该值。如果它可能在线路上设置断点并检查您收到的user对象。

+0

parse.com数据库中的用户类具有电子邮件的值 –