I don't know where is the issue with this code? it gives a blank imageView in Nav header....
This is the code:
final View header = navigationView.getHeaderView(0);
TextView text = (TextView) header.findViewById(R.id.TxtUsernametitle);
TextView Tmail = (TextView)header.findViewById(R.id.textmail);
imageView1 = (ImageView)header.findViewById(R.id.imageView1);
String Tusern = currentUser.getUsername();
String Tmails = currentUser.getEmail();
text.setText(Tusern);
Tmail.setText(Tmails);
String usId= currentUser.getObjectId().toString();
ParseQuery<ParseObject> query = ParseQuery.getQuery("Profile");
query.whereEqualTo("userID", usId);
query.getFirstInBackground(new GetCallback<ParseObject>() {
public void done(ParseObject object, ParseException e) {
if (object == null) {
ParseFile fileObject = (ParseFile) object.getParseFile("picture");
fileObject
.getDataInBackground(new GetDataCallback() {
public void done(byte[] data,
ParseException e) {
if (e == null) {
// Decode the Byte[] into
// Bitmap
Bitmap bmp = BitmapFactory
.decodeByteArray(
data, 0,
data.length);
// initialize
// ImageView imageView1 = (ImageView)header.findViewById(R.id.imageView1);
// Set the Bitmap into the
// ImageView
imageView1.setImageBitmap(bmp);
} else {
}
}
});
} else {
}
}
});
It doesn't any log or errors in my screen...
Your help will be appreciated!!! Regards, Marwan