I am new to Android Development. I've been spending a lot of time trying to have my ExpandableListView checkbox states saved to the Sharedpreferences, but I am having so much trouble with it. I am coming to an end to the solution, and I think the only way to keep the groupPosition and childPosition in the SharedPreferences is to use Json arraylist with Switch-Case. Since Json only allows me to remove only 1 index, there is no way I can remove the check state without this switch-case statement.
The problem is I have to make a switch-case with the following:
case 0:
GroupPosition = 10 + GroupPosition;
break;
case 1:
GroupPosition = 20 + GroupPosition;
break;
case 2:
GroupPosition = 30 + GroupPosition;
break;
case 3:
GroupPosition = 40 + GroupPosition;
break;
.......
.......
case 100:
GroupPosition = ...... + GroupPosition;
break;
My question is:
How does this affect the performance?
Thank you