I have a custom class with 3 String fields (arg1, arg2, arg3) and getters/setters. In Fragment there are 3 editText fields that create a new Object of custom class. And I also have an ArrayList of custom objects (max capacity is 15, but its usualy around 1-3) that is stored in SharedPreferences.
Everything worked fine until last update in which I only changed some UI design features in xml. Not a single line of Java code was changed, especialy those that have something to do with Custom objects, ArrayList or SharedPrefs.
Now some users, after updating my app, get corrupted first (or in most cases, only) entry of ArrayList, and arg1 is "" or null.
The worst thing is they are displayed the value of arg2 where is explicitly called textView.setText(arg1).
Im saving my SharedPrefs in onStop() and restoring it in onCreate() and I'm using Gson/Json for storing. In 99,9% everything is fine, but after recent update, some users reported this problem.
What's going on, and how to prevent it from happening in the future?
EDIT:
What about the fact that I set my ArrayList to be public static, so I can use it elsewhere, would it be a problem? Also since I can't debug production app, I've noticed that either args or their values have moved like MyCustomObject("val1", "val2", "val3") is now MyCustomObject("val2", "val3", "???") I dont know what last value is. Is it val1 or ""