I need to pass an ArrayList across activities and make it persistent. From a popular SO post i found the solution. But still I cannot understand why SharedPreference from API 11 takes a Set SharedPredferences.getStringSet but not a so common ArrayList directly. What are the logic reasons, ex. as to avoid duplicates using a Set for instance?
If you only need to persist simple flags and your application runs in a single process SharedPreferences is probably enough for you. It is a good default option.
There are two reasons why you might not want to use SharedPreferences:
You should can use Bundle to share list to another activities. If it is a globally used stuff keep it in your Database(Sqlite)