0

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

smokedawg
  • 1
  • 1

1 Answers1

0

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

smokedawg
  • 1
  • 1
  • Why "`type="reset"` on the button" doesn't appear on the question? You must include all the relevant information, e.g.: your code. – Machado Apr 07 '17 at 20:54