I am using firebase to retrieve data from database n use
Map
to get values, but it
The error points out correctly where you are going wrong
Map map = dataSnapshot.getValue(Map.class);
Map class uses parameter to define the types of Key and Object where as you don't give them and simply use Map.class which fails.
Try the below code - since Key are always string and we can have any type of Object for them
Map map = (Map) dataSnapshot.getValue();