saveInBackground回调不工作回调、工作、saveInBackground

2023-09-05 02:00:00 作者:我很懒连心里的人都懒得换

要求低于code数次(5-10次),完成后()方法SaveCallback不火和整个应用程序似乎卡住了。看来,这个请求废墟请求队列和所有其他的查询不火的试镜。在回调中,并在日志中没有错误。 在保存前 - 在日志中显示,而拯救 - 没有

我是否需要更改解析定价合同,或以某种方式改变我的code?

  Log.d(消息对象,在保存前);
    messageParseObject.saveInBackground(新SaveCallback(){
        @覆盖
        公共无效完成(最终ParseException的E){
            Log.d(消息对象,拯救);
            如果(E!= NULL){
                completitionCallback.error(E);
                返回;
            }

            chatObject.put(ModelConstants.LAST_MESSAGE_KEY,messageParseObject);
            chatObject.getRelation(ModelConstants.MESSAGES_KEY)。新增(messageParseObject);
            chatObject.saveInBackground(新SaveCallback(){
                @覆盖
                公共无效完成(ParseException的E){
                    Log.d(聊天对象,拯救);
                    如果(E == NULL)
                        completitionCallback.success();
                    其他
                        completitionCallback.error(E);
                }
            });
        }
    });
 

解决方案

面对这真的让我抓狂。这是我发现了什么。如果类是在Parse.com已经建立,即使有小的差异saveInBackground和saveEventually失败,没有任何错误。

最好的方式,如果发生这种情况是删除Parse.com创建类,并让Android SDK的自动调用它它在第一次调用。

至少这奏效了我。

After calling code below for several times(5-10 times), done() method for SaveCallback doesn't fire and whole application seems to stuck. It seems that this request ruins request queue and all further queries doesn't fire their callbacks either. No errors in callbacks and in logs. " BEFORE SAVING" - displayed in logs, while " SAVED" - didn't.

秋名山币王 10月15日局部主流崩塌,现货出局规避风险

Do I need to change parse pricing contract, or to change my code somehow?

    Log.d("MESSAGE OBJECT", " BEFORE SAVING");
    messageParseObject.saveInBackground(new SaveCallback() {
        @Override
        public void done(final ParseException e) {
            Log.d("MESSAGE OBJECT", " SAVED");
            if (e != null){
                completitionCallback.error(e);
                return;
            }

            chatObject.put(ModelConstants.LAST_MESSAGE_KEY, messageParseObject);
            chatObject.getRelation(ModelConstants.MESSAGES_KEY).add(messageParseObject);                
            chatObject.saveInBackground(new SaveCallback() {
                @Override
                public void done(ParseException e) {
                    Log.d("CHAT OBJECT", " SAVED");
                    if (e == null)
                        completitionCallback.success();
                    else
                        completitionCallback.error(e);
                }
            });
        }
    });

解决方案

Faced this and really drove me crazy. This is what I found. If the Class is already created in Parse.com, even if there is a small discrepancy saveInBackground and saveEventually fails without any error.

Best way, if this happens is to delete the created class in Parse.com and let the android SDK call it it automatically in the first invocation.

At least that did the trick for me.

 
精彩推荐
图片推荐