如何将我的 Arraylist 保存到 SQLite 数据库中? [英] How to save my Arraylist into SQLite database?

查看:29
本文介绍了如何将我的 Arraylist 保存到 SQLite 数据库中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想保存我的ArrayList>mylist = new ArrayList>() 在 SQLite 数据库中,然后检索它以显示存储在其中的项目.我怎样才能做到这一点?请举例说明.提前致谢:)

I want to save my ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>() in SQLite database and later retrieve it to display the items stored in it. How can I achieve this? Please provide examples. Thanks in Advance :)

推荐答案

教程链接

请参考上面的链接.我有一个使用 HashMap 使用 SQliteOpenHelper 进行 SqlLite 操作的工作示例.它一次插入一个,但如果您希望在一个实例中将它们全部插入,您可能想要创建一个循环.

Please refer to the link above. I has a working example of using HashMap for SqLite operations using SQliteOpenHelper. It has one insertion at a time, but you might wanna create a loop, if you wish to insert them all in one instance.

这篇关于如何将我的 Arraylist 保存到 SQLite 数据库中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆