Loading...
Logo
Processing Forum
I need to run some code every time my program closes. I saw something like "onDestroy" somewhere, but I get an error whenever I try to use it.

Replies(2)

its

public void stop() {
 //do something here
}


You can close the app by pressing home, or back.  Home will pause it, firing off onPause(), while pressing back will actually close it, firing off in order onPause(), onStop(), onDestroy()

cedrickiefer, did you mean onStop(), or is stop() something Processing specific? (I'd not heard of that one yet)