title: Error while trying to get a Double value from HashMap String,Object fetched from Firebase
body: <p>I don't know if this is a Firebase bug, Android bug or my fault. My issue is that I can't for some reasons get a Double value from Hashmap when fetching a child. Why? Because</p>
  
  <pre><code>java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Double
  </code></pre>
  
  <p>Apparently every numeric value stored in a firebase json object gets returned from the HashMap as Long. The more strange thing? Using debugger, I actually found out that Android Studio knows they're kinda double/float, indeed if the value to fetch is 2.5, it prints out that the value of the hashmap for key "string" is 2.5. </p>
  
  <p>When assigning this value to my double variable, it prints out the error above.</p>
  
  <p>This is the code</p>
  
  <pre><code>final double[] rating = {0};
  final int[] nRatings = {0};
  Firebase ref = new Firebase("https://MYAPP.firebaseio.com/reviews");
  Query queryRef = ref.orderByChild("idCommented").equalTo(mId);
  queryRef.addChildEventListener(new ChildEventListener() {
      @Override
      public void onChildAdded(DataSnapshot snapshot, String previousChild) {
          System.out.println(snapshot.getKey());
  
          Map map = (HashMap) snapshot.getValue();
          rating[0] += (double) map.get("noStars"); // This line causes error
          nRatings[0]++;
  
          mRatingBar.setRating((float)rating[0]/nRatings[0]);
      }
  ...
  });
  </code></pre>
  
  <p>Still, if I should debug that iteration to check map value, it would print that Long cannot be cast to Double</p>
  
  <p>Any idea why this happens? </p>