It depends. It will return true as soon as the framework knows it is on its way to finishing. If you call finish() it will be set after that, but your activity may be pretty much anywhere in its lifecycle when it is told to finish -- resumed, started, etc.
For freeing resources in your code, you generally do this in onPause(), onStop(), or onDestroy() (dependent on the semantics you want), NOT dependent on whether isFinishing() is set. The code you have here will leak, for example, if the activity is being restarted due to a configuration change. On Thu, May 20, 2010 at 8:21 AM, Jeremiah Sellars <[email protected]>wrote: > ...or when is the earliest I can detect it? Here's my situation... > > I've got an OpenGL game in the works. When the activity is ended > (however this happens either by Android or user quitting) I'd like > like to do some cleanup. I'm already calling a native function to free > some memory that was allocated and those calls are fine, but I'm also > trying to call glDeleteTextures(). I've tried a few things and > currently I have this in OnPause()... > > @Override > protected void onPause() { > super.onPause(); > mGSGLView.onPause(); > > if(isFinishing()){ > GSNFreeMem(); //Native cleanup function > } > > } > > Logcat complains that I'm calling an OpenGL ES API when there is no > current context. I've read some threads about what to look for and > checking for back button presses, etc... seems bad so I want to let > Android tell me when to do this. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

