在某些设备上和某些情况下,我会遇到此问题,并且无法100%复制。有时,当用户离开我的活动时,他们会收到以下错误消息:Activity reported stop, but no longer stopping: ActivityRecord
,通常情况下,它后面是一个ANR,例如:
02-26 19:43:31.187 I/InputDispatcher( 1062): Application is not responding: Window{8f7e457 u0 gb.xxy.hr/gb.xxy.hr.player}. It has been 5000.8ms since event, 5000.6ms since wait started. Reason: Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 14. Wait queue head age: 6964.8ms.
02-26 19:43:31.208 I/WindowManager( 1062): Input event dispatching timed out sending to gb.xxy.hr/gb.xxy.hr.player. Reason: Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 14. Wait queue head age: 6964.8ms.
02-26 19:43:31.270 E/ActivityManager( 1062): ANR in gb.xxy.hr (gb.xxy.hr/.player)
02-26 19:43:31.270 E/ActivityManager( 1062): PID: 14732
02-26 19:43:31.270 E/ActivityManager( 1062): Reason: Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 14. Wait queue head age: 6964.8ms.)
02-26 19:43:31.270 E/ActivityManager( 1062): Load: 0.0 / 0.0 / 0.0
02-26 19:43:31.270 E/ActivityManager( 1062): CPU usage from 179169ms to 0ms ago (2019-02-26 19:40:32.074 to 2019-02-26 19:43:31.243):
我的活动onstop中没有代码,但是我确实有一些代码可以释放表面:
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
myLog.d(TAG,"Surface Destroyed.");
try {
holder.removeCallback(this);
holder.getSurface().release();
}
catch (Exception e)
{
myLog.e(TAG,e.getMessage());
}
videoexecutor.shutdownNow();
visible=false;
m_codec.stop();
m_codec.release();
m_codec=null;
}
我确实看过一个类似的问题:Android onStop times out despite doing no work,但我确实认为这是由表面造成的,但我无法弄清楚实际上是什么原因造成的,为什么不在所有设备上都如此?一直。...
有什么想法吗?