如何一个ArrayList的内容存储在表中的一列在SQLite数据库中的Android? [英] how to store the contents of an arraylist in one column of table in sqlite database in android?
本文介绍了如何一个ArrayList的内容存储在表中的一列在SQLite数据库中的Android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有字符串的ArrayList。我needt到数组列表存储在数据库中的1列。
我该怎么做?
I am having an arraylist of strings. I needt to store that arraylist in the 1 column of database. How can I do that?
推荐答案
采用String,追加数组列表的指数字符串循环的帮助
take a String, append arraylist's index string with the help of loop
String all="";
for(int i=0;i<arraylist.lenght;i++)
{
all=all+" "+ arraylist.get(i).tostring;
}
现在存储所有,在你的数据库字段,只有这个问题的尺寸
希望你有我的意思
now store "all" in your DB field, only the problem with this is SIZE, hope you got what i meant
这篇关于如何一个ArrayList的内容存储在表中的一列在SQLite数据库中的Android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文