I tried so many suggestions: I got to know that we can store the String set in Shared pref, but I have an Integer array list. Now if I'll try Integer Arralist to String arraylist and store in Shared Pref and again do the same, so lengthy process and lots of exception.
Is there any other way?
Make sure I want to use Shared Pref, no other things:
Code:
public Set<String> getAppointmentStatusPosList() {
return sharedPreferences.getStringSet(APPOINTMENT_STATUS_ID_LIST, null);
}
public void setAppointmentStatusPosList(Set<String> vitalId) {
editor.putStringSet(APPOINTMENT_STATUS_ID_LIST, vitalId);
editor.apply();
}
@Override
public void selectedIndices(List<Integer> indices) {
Set<Integer> set = new HashSet<>();
set.addAll(indices);
preferenceManager.setAppointmentStatusPosList(set);
// list1 = indices;
}