James Andrew
James Andrew

Reputation: 21

Sometimes saveInBackground's callback never get called

I'm writing a chat application on Android using the Parse SDK (1.5.1) in which i use obj.saveInBackground(SaveCallback) to create a new chat message on the cloud. The problem is that sometimes the SaveCallback never get called (I put a log inside the callback and that log never be printed out). This usually occurs when i continuously send out about 20-30 chat messages, for each message, i use saveInBackground to create it, but the callback just be called for the first messages (for example, it was ok to create message 1 to 30, but for message 30-40, the callbacks were not called and they couldn't be created).

It seems that when the problem occurs, all the "ParseRequest.NETWORK_EXECUTOR-thread-xx" threads are in the Wait status (maybe they are waiting for results sent back from server?). Please take a look at the application's threads snapshot when this problem occurs.

Is there anyone encountered a similar problem before? Could you please give me advices how to deal with it? Thanks!

Upvotes: 2

Views: 627

Answers (1)

Naveed Ali
Naveed Ali

Reputation: 2619

I faced similar problem in case of files, so I used recursion function. may be you have to call recursion method of saving messages until all messages are saved to parse...

Upvotes: 1

Related Questions