I'm Learning the Firebase Database with Android, Having array of data in Firebase Database Like Below image.
cineIndustry is an Array of data. In JSON it looks Like this
"cineIndustry" : [ {
"type" : "Hollywood"
}, {
"type" : "Kollywood"
}, {
"type" : "Bollywood"
} ]
I want Insert new data in this Array.
POJO Class
@IgnoreExtraProperties
public class CineIndustry {
void CineIndustry(){}
public String type;
}
Save new data
CineIndustry cineIndustry = new CineIndustry();
cineIndustry.type = cineType.getText().toString();
mDatabase.setValue(cineIndustry);
When i insert like above it will replace Array. JSON Structure was change to normal JSON object instated of JSON Array.
Anyone know help me to solve this issue.
