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.
我正在使用游标从 SQLite 检索数据,该数据以字符串格式返回结果。有什么方法可以使用光标以 JSON 格式获取输出?
您不能将 a 的内容cursor直接转换为 a JSONObject,但您可以通过一些逻辑来做到这一点。
cursor
JSONObject
例如:Strings从 中检索cursor,形成String遵循JSON格式的 a ,并使用它来制作 json 对象:
Strings
String
JSON
JSONObject jFromCursor=new JSONObject(string_in_JSON_format);