I have a java class
public class PRODUTO extends SugarRecord implements Parcelable {
private float id_pro;
public PRODUTO(float id_pro){
this.id_pro = id_pro;
}
public float getId_pro() {
return id_pro;
}
public void setId_pro(float id_pro) {
this.id_pro = id_pro;
}
// PARCELABLE
public PRODUTO(Parcel parcel) {
setId_pro(parcel.readFloat());
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel parcel, int i) {
parcel.writeFloat(getId_pro());
}
...
}
A php API that returns me a JSON from my mysql base, in it comes id_pro , for example: 257895
But always add automatically a ". 0" at the end of the variable AFTER ASSIGNING THE CLASS,
I've checked the return data, it comes right from JSON, but at the time of assigning the class it stays like this, on the mysql base I have a bigint field that I've already moved to float also to test and did not. But when I use String in the class for id_pro , it correctly gets 257895, but I wanted to work directly on the object's format.
I use a HttpURLConnection for the request.
Does anyone have an idea of what I'm doing wrong?