I'm using Android Studio Chipmunk 2021.2.1 Patch 1 Android Studio Chipmunk | 2021.2.1 Patch 1 Target SDK 31, Min SDK 23
I'm importing data from a web service that looks like this: I added the last seven boolean values. The oncall was there before and have always worked, but the seven I added always return 0.
"accountnum":"9922264","oncall":true,"oncalldate":null,"routepausefrom":null,"routepauseto":null,"mon":true,"tue":true,"wen":null,"thu":null,"fri":null,"sat":null,"sun":null
Then I add to the sqlite database;
cusdatasource.createCustomer(Integer.parseInt(customerResult.d.results.get(i).accountnumStr),(customerResult.d.results.get(i).oncallBool) ? 1:0, OnCallDate, FromDate, ToDate,(customerResult.d.results.get(i).monBool) ? 1:0,(customerResult.d.results.get(i).tueBool) ? 1:0, (customerResult.d.results.get(i).wenBool) ? 1:0,(customerResult.d.results.get(i).thuBool) ? 1:0,(customerResult.d.results.get(i).friBool) ? 1:0, (customerResult.d.results.get(i).satBool) ? 1:0,(customerResult.d.results.get(i).sunBool) ? 1:0);
Here is the variables populated before added to the database.
OnCall = 1 OnCallDate = " " cusurl = "" vacfrom = " " vacto = " " Monday = 0 Tuesday = 0 Wednesday = 0 Thursday = 0 Friday = 0 Saturday = 0 Sunday = 0
All but the first onCall convert right, to either 1 or 0 depending if it is true or false, but all the other boolean always convert to 0 regardless. I spend hours looking for something, but all the settings of all variables are the same for the working one and the not working one.
Thanks for any help.
I found the problem, the Customer Class with the SerializedName is case sensitive and therefore even the result from the webservice was correct, the SerializedName didn't find the name, because I had Mon instead of mon.