Class java.util.Map has generic type parameters, please use GenericTypeIndicator instead

后端 未结 6 1259
既然无缘
既然无缘 2020-11-29 09:11

I am using firebase to retrieve data from database n use

Map map = dataSnapshot.getValue(Map.class);

to get values, but it

6条回答
  •  误落风尘
    2020-11-29 09:51

    I had the same problem and solved it by handling the Object instead trying to have Firebase cast it.

    Map  map = (Map)dataSnapshot.getValue();
    

    did it for me.

提交回复
热议问题