在onPause之前检测方向更改

时间:2012-06-18 02:08:58

标签: android android-layout orientation-changes android-orientation

我在Activity的custom Dialog方法之外的方法中创建onCreateDialog。当设备的方向发生变化时,我得到了许多其他人得到的通常泄露的窗口错误:

06-15 23:47:07.712: E/WindowManager(964): Activity com.betweenthehills.TestVideoPlayerActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@44ef8438 that was originally added here
06-15 23:47:07.712: E/WindowManager(964): android.view.WindowLeaked: Activity com.betweenthehills.TestVideoPlayerActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@44ef8438 that was originally added here

我意识到我需要在Activity被销毁之前解除对话框;但我无法重写Activity方法。有没有办法在活动onPause>onDestroy周期开始之前检测方向变化?

0 个答案:

没有答案