I want to fetch image from table 1 to update image in table 2 on parse here is my code
ParseFile image= ParseUser.getCurrentUser().getParseFile("image");
if(image==null)
{
}
else
{
try {
byte[] data=image.getData();
Bitmap bmp = BitmapFactory
.decodeByteArray(
data, 0,
data.length);
// Set the Bitmap into the
// ImageView
image1.setImageBitmap(bmp);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
This code is working perfect it retrieves and set image properly now I want this "image" to upload in my Second table I am doing this
ParseQuery<ParseObject> query = ParseQuery.getQuery("XYZ");
String user_id=ParseUser.getCurrentUser().getObjectId();
query.getInBackground(user_id, new GetCallback<ParseObject>() {
@Override
public void done(ParseObject pdata, ParseException e) {
// TODO Auto-generated method stub
pdata.put("image",image); // this line throw NullPointerException
pdata.saveInBackground();
}
});
What I am doing wrong anyone please help?