Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/195.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,我有一个检索解析对象的查询: 我试着调试回调函数,我发现我得到了正确数量的对象,但它们的值都是空的。 尽管有一个叫做“state”的值,我在其中获取值 我做错了什么?如何正确获取值 final List<Kehila> newKehilas = new ArrayList<>(); ParseQuery<ParseObject> query = ParseQuery.getQuery("Kehila"); query.findInBackg

我有一个检索解析对象的查询: 我试着调试回调函数,我发现我得到了正确数量的对象,但它们的值都是空的。 尽管有一个叫做“state”的值,我在其中获取值 我做错了什么?如何正确获取值

  final List<Kehila> newKehilas = new ArrayList<>();
    ParseQuery<ParseObject> query = ParseQuery.getQuery("Kehila");
    query.findInBackground(new FindCallback<ParseObject>() {

        @Override
        public void done(List<ParseObject> list, ParseException e) {
            if (e != null) {
                Log.e("UNITE", e.toString());
            } else {

                for (ParseObject k : list) {

                    Kehila newKehila = new Kehila();
                    newKehila.setObjectId(k.getString("objectId"));
                    newKehila.setName(k.getString("name"));
                    newKehila.setCity(k.getString("city"));
                    newKehila.setNeighborhood(k.getString("neighborhood"));
                    newKehila.setStreet(k.getString("street"));
                    newKehila.setHouseNumber(k.getInt("houseNumber"));

                    newKehilas.add(newKehila);
                }
            }

        }
    });
   return newKehilas;
final List newKehilas=new ArrayList();
ParseQuery=ParseQuery.getQuery(“Kehila”);
findInBackground(新的FindCallback(){
@凌驾
公共作废完成(列表,异常解析){
如果(e!=null){
Log.e(“UNITE”,e.toString());
}否则{
for(parsek对象:列表){
Kehila newKehila=新Kehila();
setObjectId(k.getString(“objectId”);
newKehila.setName(k.getString(“名称”));
newKehila.setCity(k.getString(“城市”));
newKehila.setNeighborhood(k.getString(“neighborhood”);
newKehila.setStreet(k.getString(“street”);
newKehila.setHouseNumber(k.getInt(“houseNumber”);
添加(newKehila);
}
}
}
});
返回纽基希拉斯;

我认为您需要对新对象调用
save()
savefinally()

这段向列表中添加元素的代码是异步运行的,因此末尾的return语句可能会返回一个空列表。它们是仪表板中的对象。每当我试图通过getX访问其中一个值时,它都会崩溃。。。