In my snapshot, whenever my phone goes to sleep, and I awake it, all the items in a snapshot is gone.
How to resolve this?
here is my code for snapshot :
for i = 1,#weekdays do snapWeekDays[i] = display.newSnapshot(90,90) end
this is how I populate it with a rectangle and a text
for i = 1, #weekdays do local box = display.newRect(0,0, 45,45) box:setFillColor(0.043, 0.360, 0.043) box.anchorX = 0 box.anchorY = 0 snapWeekDays[i].group:insert(box) local text = display.newText( { parent = snapWeekDays[i].group, text = weekdays[i].abv, font = native.font, y = 10, height = 20, width = 30, x = 10, align="center", fontSize = 20 }) text.anchorX = 0 text.anchorY = 0 snapWeekDays[i].x = currentX snapWeekDays[i].y = 150 -- snapWeekDays[i].y = currentY print("currentX "..currentY) currentY = currentY + 46 currentX = currentX + 46 sceneGroup:insert(snapWeekDays[i]) end
it goes well when my app goes to this part and my phone goes to sleep and i awake it, the snapshot is gone totally,