I was getting these logs in my video player application. These messages 
were thrown while the video player was closed. Interestingly, I used to get 
these logs once in a few runs in a random manner. Also my application does 
not involve in any progress dialog or Async Task. Finally, I got around 
this issue with the below implementation. 

@Override
protected void onPause()
{
Log.v("MediaVideo", "onPause");
super.onPause();
this.mVideoView.pause();
this.mVideoView.setVisibility(View.GONE);
}

@Override
protected void onDestroy()
{
Log.v("MediaVideo", "onDestroy");
super.onDestroy();
}

@Override
protected void onResume()
{
Log.v("MediaVideo", "onResume");
super.onResume();
this.mVideoView.resume();
}

Override the OnPause with call to mVideoView.pause() and the set visibility 
to GONE. This way I could resolve the "Activity has leaked window" log 
error issue.

On Monday, June 18, 2012 3:59:40 PM UTC+5:30, Vance Turnewitsch wrote:
>
> Thanks. I tried using the method and it appears that the method gets 
> called after the Activity has been destroyed and during some process of 
> recreating the Activity:
>
> 06-18 06:26:32.639: E/WindowManager(1767): Activity 
> com.betweenthehills.TestVideoPlayerActivity has leaked window 
> com.android.internal.policy.impl.PhoneWindow$DecorView@4472fd38 that was 
> originally added here
> 06-18 06:26:32.639: E/WindowManager(1767): android.view.WindowLeaked: 
> Activity com.betweenthehills.TestVideoPlayerActivity has leaked window 
> com.android.internal.policy.impl.PhoneWindow$DecorView@4472fd38 that was 
> originally added here
> 06-18 06:26:32.639: E/WindowManager(1767):     at 
> android.view.ViewRoot.<init>(ViewRoot.java:247)
> 06-18 06:26:32.639: E/WindowManager(1767):     at 
> android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
> 06-18 06:26:32.639: E/WindowManager(1767):     at 
> android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
> 06-18 06:26:32.639: E/WindowManager(1767):     at 
> android.view.Window$LocalWindowManager.addView(Window.java:424)
> 06-18 06:26:32.639: E/WindowManager(1767):     at 
> android.app.Dialog.show(Dialog.java:241)
> 06-18 06:26:32.639: E/WindowManager(1767):     at 
> com.betweenthehills.TestVideoPlayerActivity$5.onClick(TestVideoPlayerActivity.java:126)
> 06-18 06:26:32.639: E/WindowManager(1767):     at 
> android.view.View.performClick(View.java:2408)
> 06-18 06:26:32.639: E/WindowManager(1767):     at 
> android.view.View$PerformClick.run(View.java:8816)
> 06-18 06:26:32.639: E/WindowManager(1767):     at 
> android.os.Handler.handleCallback(Handler.java:587)
> 06-18 06:26:32.639: E/WindowManager(1767):     at 
> android.os.Handler.dispatchMessage(Handler.java:92)
> 06-18 06:26:32.639: E/WindowManager(1767):     at 
> android.os.Looper.loop(Looper.java:123)
> 06-18 06:26:32.639: E/WindowManager(1767):     at 
> android.app.ActivityThread.main(ActivityThread.java:4627)
> 06-18 06:26:32.639: E/WindowManager(1767):     at 
> java.lang.reflect.Method.invokeNative(Native Method)
> 06-18 06:26:32.639: E/WindowManager(1767):     at 
> java.lang.reflect.Method.invoke(Method.java:521)
> 06-18 06:26:32.639: E/WindowManager(1767):     at 
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
> 06-18 06:26:32.639: E/WindowManager(1767):     at 
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
> 06-18 06:26:32.639: E/WindowManager(1767):     at 
> dalvik.system.NativeStart.main(Native Method)
> 06-18 06:26:32.795: W/TimedEventQueue(1014): Event 1078 was not found in 
> the queue, already cancelled?
> 06-18 06:26:32.795: D/TIOverlay(1098): overlay_destroyOverlay:IN dev 
> (0x129428) and overlay (0x4f5d28)
> 06-18 06:26:32.818: I/TIOverlay(1098): Destroying 
> overlay/fd=129/obj=004f5d28
> 06-18 06:26:32.818: D/TIOverlay(1098): overlay_destroyOverlay:OUT
> 06-18 06:26:33.801: D/TI_Video_Decoder(1014): VIDDEC_SendCommand: Received 
> request from omx client to change state to 2
> 06-18 06:26:33.801: D/TI_Video_Decoder(1014): Handle request for state 
> transition: 3 => OMX_StateIdle
> 06-18 06:26:33.811: D/TI_Video_Decoder(1014): VIDDEC_SendCommand: Received 
> request from omx client to change state to 1
> 06-18 06:26:33.811: D/TI_Video_Decoder(1014): OMX_StateIdle state reached
> 06-18 06:26:33.826: D/TIOMX_CORE(1014): Found matching pHandle(0x1dd80) at 
> index 1 with refCount 1
> 06-18 06:26:33.842: I/VidView..onDetached(1767): Detaching video 
> view...1340015193849
> 06-18 06:26:33.842: I/Frame..onDetached(1767): Detaching framelayout...
> 06-18 06:26:33.881: I/onMeasure(1767): On Measure has been called
>
> On Sunday, June 17, 2012 11:32:49 PM UTC-4, TreKing wrote:
>>
>> On Sun, Jun 17, 2012 at 9:05 PM, Vance Turnewitsch wrote:
>>
>>> so should override that method for the Dialog or the view in my dialog?
>>
>>
>> I think it would be the View that "owns" the dialog. In this case maybe 
>> your FrameLayout? Or the "resizeVidView"?
>>
>>
>> -------------------------------------------------------------------------------------------------
>> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago 
>> transit tracking app for Android-powered devices
>>
>>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to