I have successfully integrated the facebook login in my Android application. Therefore, I display user profile information such as name, email address and image.
Now I need to store user data such as name, email address and profile picture in the database. I know how to get the name and email address as it can be obtained from TextViews. But I'm trying to get a profile picture.
A profile image is displayed using ProfilePictureView.
I tried converting this image in ProfilePictureView to an array of bytes, but it does not work. (This usually works with ImageView, Imagebuttons , but does not work with ProfilePictureView )
pic.setProfileId(user.getId());
ImageView imageView = (ImageView)pic.getChildAt(0);
Bitmap bmp = ((BitmapDrawable) imageView.getDrawable()).getBitmap();
image_ = convertImageToByte(bmp);
private byte[] convertImageToByte(Bitmap bitmap) {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, stream);
return stream.toByteArray();
}
, , .
![enter image description here](https://fooobar.com//img/68dbdf1d4917e8d8b1c39a7f395323d9.jpg)
? (, , , , )
.