Java 当超过12个对象添加到一个表中时,LibGDX游戏在android上崩溃

Java 当超过12个对象添加到一个表中时,LibGDX游戏在android上崩溃,java,android,libgdx,Java,Android,Libgdx,我正在尝试为我的游戏制作一个在线排行榜。服务器端部分还可以,在桌面版游戏中运行良好 然而,在安卓系统上,它会在没有任何警告的情况下崩溃。为了获得排行榜数据,我使用HTTPUrlConnection请求,然后使用LibGDX的JsonReader类解析数据 当我解析完数据后,这个函数 private void updateHighscoresTable(JsonValue value) { int count = value.getInt("count"); for (int i

我正在尝试为我的游戏制作一个在线排行榜。服务器端部分还可以,在桌面版游戏中运行良好

然而,在安卓系统上,它会在没有任何警告的情况下崩溃。为了获得排行榜数据,我使用HTTPUrlConnection请求,然后使用LibGDX的JsonReader类解析数据

当我解析完数据后,这个函数

private void updateHighscoresTable(JsonValue value) {
    int count = value.getInt("count");

    for (int i = 0; i < 12; i++) {
        JsonValue child = value.get("" + i);

        String nickname = child.getString("nickname");
        int score = child.getInt("score");

        highscoresScreen.highscoresTable.center();
        highscoresScreen.highscoresTable.add(nickname).width(getCellWidth());
        highscoresScreen.highscoresTable.add("" + score);
        highscoresScreen.highscoresTable.row();

    }

    highscoresScreen.highscoresTable.setVisible(true);
}
如果我在创建表之后立即添加50个元素,删除前面函数中的for循环,它不会崩溃,但对我来说没有用。 JSON解析没关系,我在for循环中添加了System.out.println,一切正常


我使用的是2014年2月14日的夜间版本。

问题是我只将highscoresTable设置为隐藏,而实际上我应该将highscoresScrollPane设置为隐藏

因此:

解决了这个问题

    highscoresTable = new Table(skin);
    highscoresTable.setSize(460, 240);
    highscoresScrollPane = new ScrollPane(highscoresTable);
    highscoresScrollPane.setBounds(10, 40, 460, 240);

    highscoresScrollPane.setFadeScrollBars(false);
    highscoresTable.setVisible(false);
highscoresScrollPane.setVisible(false)