TideSDK Ti.App restart()

126 Views Asked by At

i cant figure out how o use the tidesdk api. It says on there documentation to use Ti.App and the restart() function but i tried a couple ways with no luck and also tried to imitate how the ti.media.sound is scripted which i have working but i cant figure out the app restart. Thak you in advance.

I have tried multiple variations of making functions and directly using onclick.

<script>
function restart(){
    var restart = Ti.App.restart();

}

</script>

onClick="restart()"
onClick="restart(Ti.App.restart())"

Heres the documenttion by the way

http://tidesdk.multipart.net/docs/user-dev/generated/#!/api/Ti.App

1

There are 1 best solutions below

1
smokedawg On

Ok i figured out the issue, using the type="reset" on the button it would clear the form and not restart the app, so if i put normal button it restartedbut didnt claer form. To fix this problem i simply added a time delay to make it clear form and then restart like so on the button type reset.

onClick="setTimeout(function(){Ti.App.restart();}, 1000);"

Hope this helps someone in the future