0

I'm having a trouble saving an ArrayList to Parse.com data browser in android project

I have the following:

ArrayList<Bitmap> images = new ArrayList<Bitmap>();
ParseObject po = new ParseObject("Test");
po.put("images", images);
po.saveInBackground();  

Can anyone help me with that ??

4
  • try to test it by pass something other that ArrayList<Bitmap> like a regular String, and tell me if it works Commented Aug 7, 2014 at 12:19
  • @MuhammedRefaat yes its working well with Strings Commented Aug 7, 2014 at 12:33
  • Maybe this answer can get you on the right track. Commented Aug 7, 2014 at 13:10
  • @user3212556 look at my updated answer Commented Aug 7, 2014 at 13:18

1 Answer 1

0

So, regarding to your comment there are two possibilities:

the first one is that you fill that Bitmap ArrayList with Bitmaps which overloads your memory and causes that trouble.

the second one is that may be parse.com doesn't accept ArrayLists at all or doesn't accept ArrayList<Bitmap> as it doesn't include it in the examples of accepted Objects in the documentation, when taking a look at parse.com docs you will find that put method doesn't accept ArrayLists as a value

public void put(String key,
                Object value)

Add a key-value pair to this object. It is recommended to name keys in partialCamelCaseLikeThis.

Parameters:

key - Keys must be alphanumerical plus underscore, and start with a letter.

value - Values may be numerical, String, JSONObject, JSONArray, JSONObject.NULL, or other ParseObjects. value may not be null.

UPDATE:

you can add it as an Array<String> that contains a Strings of converted Bitmaps, this link is how to convert a Bitmap to a String and vice-Versa

and if it doesn't accept ArrayLists at all you can put each Bitmap as a String individually

Sign up to request clarification or add additional context in comments.

1 Comment

great idea,,I'm trying it Thx alot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.