I have an array of string, size 100. I have entered data in this string array. Now, I want to store this array of string using SharedPreferences
.
So my question is that, is it possible to store the entire array of string instead of storing each string individually using SharedPreferences
. If so, how that can be done.
The code I have written is used to store data individually using the loop. But I want to store the entire string array without using the loop.
Code I have written for storing individually is
SharedPreferences preferencesWrite = c.getSharedPreferences("myPreferences", 0);
SharedPreferences.Editor editor = preferencesWrite.edit();
for(int i=0; i< 100; i++)
{
editor.putString("dtHistory" + Integer.toString(i), m_dtHistory[i];
}
editor.commit();