Skip to content Skip to sidebar Skip to footer

Java.util.arraylist Cannot Be Cast To Java.util.hashmap Firebase Android

Structure of my database: a,b,s are my building names; 1,1,2 are floor numbers; 1,1,3 are flat numbers and ra111,rb111,rs231 are my user ids. I am trying to implement a list view

Solution 1:

it shows me: [null, [null, {rb111=default}]]. I am not understanding why this is happening

Reason to show null here is your firebase data tree`s some children are numbers. If you use numbers as keys in firebase db it consider as a array.

If you only use 1 as kay name that means it is second element of a array. Firebase thinks first element of array is undefined. So that is null. In [null, [null, {rb111=default}]]., 0 element is undefined but 1 is defined that is [null, {rb111=default}]. In this 0 element is undefined but 1 is defined that is {rb111=default}

I think now you understood why null object in your data object

Post a Comment for "Java.util.arraylist Cannot Be Cast To Java.util.hashmap Firebase Android"