Closed samirthebti closed 2 months ago
Please upload the code
I also get this error when onSaveInstanceState
is called in my fragment in response to navigating to another activity. However, this does not occur when calling the method in response to an orientation change.
In my case, the issue was caused by the first group in the adapter having an empty list of items. Changing that to null
got rid of the error.
Ideally, this line should be changed to if (items == null || items.isEmpty()) {
to fix it.
items == null and items.isEmpty() are two different things. If we add this condition then the empty list would be ignored. There is a possibility that the same list is being used somewhere to add the data.
There is a solution here: #104
This error appear even if i unsure the data is not empty or null in the onSaveInstace method
The trace of the Error :