如何在 ContentValues 对象中获取带引号的字符串以在 sqlite 插入中使用? SQLite 似乎对我的价值
感到窒息
1 | //inside a for loop of a NodeList |
这给了我这个错误
1 | Transaction failed. Exception: unrecognized token:":": INSERT INTO tbl_ending (fotonormal, foto, link) VALUES (https://example.com/fotonormal.jpg, https://example.com/foto.jpg, https://example.com/); |
我认为 SQL 语句应该是
1 | INSERT INTO tbl_ending (fotonormal, foto, link) VALUES ("https://example.com/fotonormal.jpg","https://example.com/foto.jpg", "https://example.com/"); |
我怎样才能得到这个输出呢?
这当然是很奇怪的行为。您的 map.put 语句中基本上有弱类型,这无济于事。我倾向于显式转换 getValue 参数,只是为了看看是否能解决问题,即:
1 | map.put("foto", (String) getValue(elm,"foto")); |
本文来自网络,不代表无忧安卓网立场,转载请注明出处。