posted 3 years ago
I have a main activity with many fragments that get replaced on each other and there state always get lost I even tried public void onSaveInstanceState(@NonNull Bundle outState) but it still didn't work I even did it in the MainActivity to retain the instance but still nothing now I have a CartOrderFragment that I add items to it from FoodListFragment when a button is clicked, but every time I go to CartOrderFragment and come back to FoodListFragment and try to add more item by clicking on the same button before, the CartOrderFragment lose its list.
MainActivity.java
CartOrderFragment.java
FoodListAdapter.java