I am trying to write a Spot object to my Firebase database. All was good an well until I added an ArrayList<> attribute to the Spot class. Now I can no longer write Spot object to the database and when I try, my app just.. stops. No crash, so I don't get any error feedback in the log :/
Here is my writing code:
public void writeSpot(Spot spot, AddSpotContract.RequiredModelOps subscriber) {
Log.i("DBGR", "writing spot");
getReference().child(spot.getId()).setValue(spot);
Log.i("DBGR", "what is going on??");//if Spot object has an ArrayList<Uri> attribute, this is never reached
subscriber.onSpotWritten();
}
So does anybody know why I can't write an object with an ArrayList<> attribute to the database? I've tried with an array, but that isn't supported (at least in that case I get the feedback to tell me that).
Thanks a lot :)
EDIT: I found the answer.
It actually had nothing to do with the ArrayList, the issue came from trying to write a Uri to the database, as it isn't a supported class (see error "java.lang.StackOverflowError:" when try to save object in Firebase Database)