当前位置:首页 > 数据库 > SQlite

插入ArrayList到Android SQLite数据库?

嗨,

我有数组的地理位置

List<GeoPoint> geoPointsArray = new ArrayList<GeoPoint>();

我想将geoPointsArray数组放入SQLite数据库,然后将数据作为数组取回.

如果有人有解决方案,我将不胜感激.

附言

现在,我使用ContentValues将数组插入为:

        ContentValues initialValues = new ContentValues();
        initialValues.put(KEY_TIME, time);
        db.insert(tableName, null, initialValues);

解决方法:

I want to put geoPointsArray array in to SQLite database and then fetch the data back as an
array.

将GeoPoint数组序列化为JSON并将其存储在TEXT列中.


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!