Activity中的isFinishing()方法
Activity销毁的原因一般是我们调用Activity的finish方法手动销毁,另一个是系统在内存紧张的情况下去销毁Activity,已达到节省空间的作用。
我们可以通过方法isFinishing()来判断Activity是否这个正在被销毁。
isFinishing()方法官方给出的解释是:
Check to see where this activity is in the process of finishing,either because you called on it or someone else has requested that it finished.This is often used in to detemine whether the activity is simply pausing or completely finishing.