[問題] bulkinsert後馬上query問題

看板AndroidDev作者 (大棵)時間10年前 (2015/04/19 20:21), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
我在thread中先用了context.getContentReslove.bulkInsert()來把資料放入db中 接著我使用了context.getContentReslove.query()來取出資料 因為我要得到_id欄位自動給的內容 可是發現所得到的cursor.getCount()得到的數量是零 感覺可能是 bulkInsert()還沒存就被query了 不知getContentReslove是否有像commit或是flush的東西 讓他能提早把內容寫入 或是有沒有辦法能夠debuug database 存取的內容 感謝各位大大 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.240.212.202 ※ 文章網址: https://www.ptt.cc/bbs/AndroidDev/M.1429446065.A.BC9.html
文章代碼(AID): #1LCvsnl9 (AndroidDev)