//SharePreference 文件的写入
public class SharePreferenceUtils {
public synchronized static void save(Map<String, String> items,Context context)
{
if(items == null || items.size() == 0) return;
SharedPreferences sharedPreferences = context.getSharedPreferences("caption", context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
String key = "";
String value = "";
for (Entry<String, String> item : items.entrySet()) {
key = item.getKey();
value = item.getValue();
if(key.length() > 0)
{
editor.putString(key, value);
}
}
editor.commit();
}
}