I have a button that calls display.captureScreen(true). In the simulator the image is saved almost instantly, however on the device it can take 5 to 10 seconds. I would like to show a modal activity indicator so that the user won’t end up tapping the button multiple times.
The following code works in the simulator, however on the device it leaves the activity indicator spinning, meaning that I have to force-quit.
Can someone please assist?
function saveScreenshot() capture = display.captureScreen(true) capture:removeSelf() capture = nil end function onButtonPress(event) native.setActivityIndicator(true) saveScreenshot() native.showAlert("My App", "Screenshot saved", {"OK"}) native.setActivityIndicator(false) end
