如何从firebase读取数据(纬度和逻辑)并在autocomplectetextView中填充它 如何访问此数据data.features.properties.adress,如下图所示
这是我的json文件的一部分
"features": [
{
"type": "Feature",
"properties": {
"x": 17.254,
"y": 20.424,
"adress": "123 rue test"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
17.73,
2.81,
1.88
],
[
17.906,
20.661,
1.88
],
[
17.95,
20.27,
1.88
],
[
17.01,
20.1832277507,
1.88
],
[
17.73,
20.81,
1.88
]
]
]
}
}]
我已经尝试过这段代码,但它什么都没给我,我不知道是什么问题
featRef.child("features/properties/adress");
featRef.addValueEventListener(new com.firebase.client.ValueEventListener() {
@Override
public void onDataChange(com.firebase.client.DataSnapshot dataSnapshot) {
for(com.firebase.client.DataSnapshot adress : dataSnapshot.getChildren()){
Log.i("adress", adress.getValue().toString()+"///////////////////////////////////////////////////////");
autoComplete.add(adress.getValue().toString());
}
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(MapsActivity.this, android.R.layout.select_dialog_item, autoComplete);
autoTextView.setAdapter(arrayAdapter);
}
@Override
public void onCancelled(FirebaseError firebaseError) {
}
});