Yes I saw the other post on this - nothing worked for me. Here's what I'm doing
Created a new Java Class
public abstract class ImageHelper {
//Post task
public static byte [] taskImage1;
}
First activity, Get image 1 + add to Byte array
ImageButton Pic1s = (ImageButton) findViewById(R.id.pic1);
Drawable drawable1 = Pic1s.getDrawable();
Bitmap bitmap1= ((BitmapDrawable)drawable1).getBitmap();
ByteArrayOutputStream baos1 = new ByteArrayOutputStream();
bitmap1.compress(Bitmap.CompressFormat.PNG, 100, baos1);
byte[] b1 = baos1.toByteArray();
ImageHelper.taskImage1 = b1;
Second activity
byte[] b1 = ImageHelper.taskImage1;
Bitmap bmp1 = BitmapFactory.decodeByteArray(b1, 0, b1.length);
ParseObject myTask = new ParseObject("Task");
myTask.put("imageFile1", bmp1);
myTask.saveInBackground()
It doesn't work, the image doesn't upload to Parse, I also tried to display the image in the second activity as a test and that didn't work either
To display the image I tried this :
byte[] b1 = ImageHelper.taskImage1;
Bitmap bmp = BitmapFactory.decodeByteArray(b1, 0, b1.length);
ImageView image = (ImageView) findViewById(R.id.bg);
image.setImageBitmap(Bitmap.createScaledBitmap(bmp, image.getWidth(),
image.getHeight(), false));