小编wem*_*pps的帖子

如何将Hashmap转换为String以保存在SQLite数据库中?

我需要找到一种方法来保存一个HashMap字符串以保存在我的SQLite数据库中以便在以后的阶段进行检索.

这是我的HashMap:

private Map<String, Bitmap> myMarkersHash new HashMap<String, Bitmap>();
Run Code Online (Sandbox Code Playgroud)

然后保存到SQlite数据库时:

contentValues.put(LocationsDB.FIELD_HASH, myMarkersHash);
Run Code Online (Sandbox Code Playgroud)

但问题是,在我得到一个错误put,在contentValues.put与此错误:

The method put(String, String) in the type ContentValues is not applicable for the arguments (String, Map<String,Bitmap>)
Run Code Online (Sandbox Code Playgroud)

所以我的问题是如何将其转换为字符串,以便我可以将其保存到我的sqlite数据库?

谢谢

java sqlite android

3
推荐指数
1
解决办法
1944
查看次数

标签 统计

android ×1

java ×1

sqlite ×1