JSONException:courseDivide没有值

时间:2018-12-04 03:13:07

标签: java android-studio

刚尝试运行,我收到此错误:

  

JSONException:CourseDivide没有值   StatisticsFragment $ ByEntire.onPostExecute(StatisticsFragment.java:225)   StatisticsFragment $ ByEntire.onPostExecute(StatisticsFragment.java:153)

我是Java的初学者,我似乎无法弄清楚JSONException没有价值的原因。

代码:

import 'dart:async';
import 'package:flutter/material.dart';

void _imageLoad() async {

    String imageName = "";

    Image downloadImage = new Image.network(imageName);

    final ImageStream stream = downloadImage.image.resolve(ImageConfiguration.empty);
    final Completer<void> completer = Completer<void>();
    stream.addListener((ImageInfo info, bool syncCall) => completer.complete());
    await completer.future;
    if (mounted) {
      //do sth
    }
}

1 个答案:

答案 0 :(得分:0)

可能是您的JSON没有courseDivide或有误,请删除')'

courseDivide = object.getInt("courseDivide");
coursePersonnel = object.getInt("coursePersonnel");
courseTime = object.getString("courseTime");