我有一系列的体力、面积100。 我已输入这一阵列中的数据。 现在,我想用<条码”储存这种阵列。 共有项目代码>。
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();