Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否可以在 SharedPreference 中保存为 double 的数组列表。在我的应用程序中,我希望在用户写入新的“大小”时保存“大小”。它必须上传到 double 的数组列表,而不删除前一个。
首先 - 你的问题的答案很简单:
这是不可能的。
但好消息是有很多方法可以保存双打数组(正如您在评论中所建议的那样):
将其保存到内部/外部存储中的二进制文件/序列化文件,到 SQLite 数据库,使其成为服务器端的责任(如果有的话..)
如果它可以帮助您从包含序列化数组的文件中读取数据,您可以将数组的大小保存在共享首选项中,但我想您已经知道了。
无论如何——祝你好运