Closed ty0521-fss closed 5 years ago
private String title; title = jsonObject.opt("title"); // Error: Incompatible types.
↓
private String title; title = jsonObject.optString("title");
private float latitude; latitude = jsonObject.optFloat("latitude"); // optFloat not exist
private float latitude; latitude = (float) jsonObject.optDouble("latitude");
Java Gson for Android
Fix method name to be "optString" instead of "opt" to get String type value from JSONObject in constructor.
↓
Fix: float type issue
↓