Can someone please tell how I can convert this bitmap to byteArray?
Here is the code
    if (requestCode == PICK_IMAGE_REQUEST && resultCode == RESULT_OK && data != null && data.getData() != null) {
        Uri uri = data.getData();
        try {
            Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), uri);
            // Log.d(TAG, String.valueOf(bitmap));
            EventBus.getDefault().post(new MessageEvent.SendMessage(contact.getJid(), null, ""));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
 
     
     
     
    