Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 我想先将数据保存在本地存储中,然后通过解析将其同步到云数据库_Android_Parse Platform - Fatal编程技术网

Android 我想先将数据保存在本地存储中,然后通过解析将其同步到云数据库

Android 我想先将数据保存在本地存储中,然后通过解析将其同步到云数据库,android,parse-platform,Android,Parse Platform,嗨,我想在应用程序离线时,按一下按钮在本地保存数据,然后在网络可用时进行同步 我正在通过解析使用savefinally(),但无法在单击按钮时保存数据 注意。当我点击按钮时,它会执行两个功能,首先保存数据,然后打开第二个活动。它还将在新的活动中使用intent objectId public void nextQues(视图){ final ProgressDialog pdia=新建ProgressDialog(StartFeedback.this); 设置消息(“正在加载问题2…请稍候…”)

嗨,我想在应用程序离线时,按一下按钮在本地保存数据,然后在网络可用时进行同步

我正在通过解析使用savefinally(),但无法在单击按钮时保存数据

注意。当我点击按钮时,它会执行两个功能,首先保存数据,然后打开第二个活动。它还将在新的活动中使用intent objectId

public void nextQues(视图){
final ProgressDialog pdia=新建ProgressDialog(StartFeedback.this);
设置消息(“正在加载问题2…请稍候…”);
pdia.show();


到底出了什么问题?toast消息一直在加载…所以问题是toast消息重复出现?或者与保存数据有关?
    final ParseObject newUser = new ParseObject("ArtofLiving");
    newUser.put("happinessIndex", textView.getText().toString());
    newUser.put("userName", ParseUser.getCurrentUser().getUsername());
    newUser.pinInBackground();
    newUser.saveEventually(new SaveCallback() {
        @Override
        public void done(ParseException e) {
            if (e == null) {
                String objectId = newUser.getObjectId();
                pdia.dismiss();
                StartFeedback.this.finish();
                Intent intent = new Intent(StartFeedback.this, QuesTwo.class);
                intent.putExtra("id", objectId);
                startActivity(intent);
            } else {
                Toast.makeText(StartFeedback.this, e.getMessage(), Toast.LENGTH_SHORT).show();
                pdia.dismiss();
                StartFeedback.this.finish();
                Intent intent = new Intent(StartFeedback.this, GreyGreen.class);
                startActivity(intent);
            }

        }
    });


}