Again having issues with Parse.com clearly I'm having issues with it. Once again it works perfectly in iOS but when I try to do the same thing in Android it fails. Error is: "Caused by: java.lang.NullPointerException
" which calls this line of code "fileObject.getDataInBackground(new GetDataCallback()
"
Basically, I'm trying to pull a specific image out of a parse.com table and display it within a ImageView. I have it working locally in other words I can call the image directly from the device. But this defeats the purpose of pulling the image from Parse.com.
I have followed the example provided on Parse.com website but clearly I'm not the only one having issues. https://parse.com/docs/android_guide#files
Below is my code located on the onCreate function;
ParseObject parseObject = new ParseObject("Birds");
ParseFile fileObject = (ParseFile) parseObject.get("totemImage");
fileObject.getDataInBackground(new GetDataCallback() {
@Override
public void done(byte[] data, ParseException e) {
if (e == null)
{
Bitmap bmp = BitmapFactory .decodeByteArray(data, 0, data.length);
ImageView pic;
pic = (ImageView) findViewById(R.id.totemView);
pic.setImageBitmap(bmp);
}
else
{
}
}
});
Any ideas on how to fix this would be great. BTW (Birds is the table/classname in parse)
Regards, Jeremy