2015-10-18 140 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數據庫中的用戶類具有電子郵件的值 –