java.lang.NumberFormatException: Erwartet einen int, sondern wurde von 0,6 auf Zeile 1 Spalte 8454

Ich bin mit dem retrofit-Bibliothek für meine Besuche in einem demo-Projekt.

Erhalte ich die folgende Fehlermeldung:

java.lang.NumberFormatException: Erwartet einen int, sondern wurde von 0,6 auf Zeile 1 Spalte 8454 path $.Ergebnis.Ergebnisse.ads[2].Hektar

Ich unter stand, dass dies nach unten zu GSON.

Zeige ich Euch das JSON-es ist immer gefangen in:

   {  
       "ad_id":739580087654,
       "property_type":"site",
       "house_type":"",
       "selling_type":"private-treaty",
       "price_type":"",
       "agreed":0,
       "priority":2,
       "description":"Beautiful elevated 0.6 acre site - zoned residential - and within easy walk to this popular and scenic coastal village\r\n\r\n\r\nthe site area is zoned residential ( i.e. can be constructed on for residential home) and has beautiful coastal views\r\n\r\nSpiddal is an exceptionally popular location , just 8 miles west of Galway City but the area has not been over developed.\r\n\r\nAll services and family amenities are location in the village centre.\r\n\r\n",
       "price":135000,
       "bedrooms":null,
       "bathrooms":null,
       "tax_section":"0",
       "square_metres":0,
       "acres":0.6,   <----------------------TRIPPING UP HERE
       "features":[  
          "Zoned residential",
          "within easy walk of coastal village of Spiddal",
          "with coastal views"
       ],
       "ber_rating":"",
       "ber_code":"",
       "ber_epi":0,             
       "city":"",
       "general_area":"Connemara",
       "postcode":null,
       "latlon_accuracy":1,
       "main_email":"",
       "cc_email":"",
       "auction_address":"",
       "start_date":1384425002,
       "listing_date":1384425002,
       "agreed_date":0,
       "auction_date":0,
       "tags":1
    },

Bin ich nicht erlebt, dass mit Retrofit-also entschieden zu lernen und zu integrieren in dieses Projekt.

Sollte jemand irgendwelche Vorschläge haben?

Ich habe keine Kontrolle über die JSON gesendet nach unten.

  • Verwenden Sie eine float statt und int.
  • in meiner Antwort-Objekt? Wird dies nicht zu Problemen führen, wo es von ints?
  • In der eigentlichen (java -) code.
  • das ist es, was ich meinte, in java-code in meiner Antwort-Objekt
  • danke, das klappte
  • Möchten Sie von mir post, dass so eine Antwort?
  • wenn Sie post wie eine Antwort werde ich akzeptieren, danke

InformationsquelleAutor DJ-DOO | 2016-01-29
Schreibe einen Kommentar