0

I have a curious issue with the VideoView. Im displaying three videos. When one is done I select the next one and so on.

It works perfectly for about three whole days. Then a video is at the very beginning, the play MediaController play button is pressed (showing the pause-sign) but nothing is happening. When I try to click the play button I get an keyDispatchingTimedOut error.

Any ideas what might be happending and how I can solve this issue?

Edit:

I restarted the app but not the device. When I call the activity containing the VideoView I get an ANR. Furthermore the whole device is reacting a bit slower than usual...

I/InputDispatcher( 2381): Application is not responding: Window{41319d40 com.android.myapp/com.android.myapp.MainActivity paused=false}.  5003.9ms since event, 5003.2ms since wait started
I/WindowManager( 2381): Input event dispatching timed out sending to com.android.myapp/com.android.myapp.MainActivity
I/Process ( 2381): Sending signal. PID: 7704 SIG: 3
I/dalvikvm( 7704): threadid=3: reacting to signal 3
I/dalvikvm( 7704): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 2381): Sending signal. PID: 2381 SIG: 3
I/dalvikvm( 2381): threadid=3: reacting to signal 3
I/dalvikvm( 2381): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 2381): Sending signal. PID: 2454 SIG: 3
I/dalvikvm( 2454): threadid=3: reacting to signal 3
I/dalvikvm( 2454): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 2381): Sending signal. PID: 2535 SIG: 3
I/dalvikvm( 2535): threadid=3: reacting to signal 3
I/dalvikvm( 2535): Wrote stack traces to '/data/anr/traces.txt'
D/dalvikvm( 2381): GC_CONCURRENT freed 644K, 10% free 9566K/10567K, paused 3ms+17ms
D/dalvikvm( 2381): GC_EXPLICIT freed 411K, 9% free 9668K/10567K, paused 2ms+6ms
E/ActivityManager( 2381): ANR in com.android.myapp (com.android.myapp/.MainActivity)
E/ActivityManager( 2381): Reason: keyDispatchingTimedOut
E/ActivityManager( 2381): Load: 6.45 / 6.46 / 6.33
E/ActivityManager( 2381): CPU usage from 7152ms to 1372ms ago:
E/ActivityManager( 2381):   99% 2282/mediaserver: 99% user + 0% kernel / faults: 3 minor
E/ActivityManager( 2381):   7.4% 1318/mmcqd/0: 0% user + 7.4% kernel
E/ActivityManager( 2381):   24% 7704/com.android.myapp: 19% user + 5.3% kernel / faults: 245 minor
E/ActivityManager( 2381):   1.2% 2381/system_server: 1.2% user + 0% kernel / faults: 24 minor
E/ActivityManager( 2381):   1.2% 7563/kworker/0:1: 0% user + 1.2% kernel
E/ActivityManager( 2381):   1% 2279/surfaceflinger: 0.5% user + 0.5% kernel
E/ActivityManager( 2381):   0.3% 7204/kworker/0:3: 0% user + 0.3% kernel
E/ActivityManager( 2381):   0% 1271/galcore daemon : 0% user + 0% kernel
E/ActivityManager( 2381):   0% 2288/magd: 0% user + 0% kernel / faults: 2 minor
E/ActivityManager( 2381):   0% 7464/kworker/u:1: 0% user + 0% kernel
E/ActivityManager( 2381):   0% 7731/kworker/1:0: 0% user + 0% kernel
E/ActivityManager( 2381): 92% TOTAL: 59% user + 28% kernel + 4.9% iowait
E/ActivityManager( 2381): CPU usage from 1006ms to 1524ms later:
E/ActivityManager( 2381):   96% 2282/mediaserver: 96% user + 0% kernel
E/ActivityManager( 2381):     96% 6962/Binder Thread #: 96% user + 0% kernel
E/ActivityManager( 2381):   38% 1318/mmcqd/0: 0% user + 38% kernel
E/ActivityManager( 2381):   19% 7704/com.android.myapp: 13% user + 5.8% kernel
E/ActivityManager( 2381):     19% 7704/.ai.mediaplayer: 13% user + 5.8% kernel
E/ActivityManager( 2381):   7.8% 7204/kworker/0:3: 0% user + 7.8% kernel
E/ActivityManager( 2381):   1.1% 2279/surfaceflinger: 0% user + 1.1% kernel
E/ActivityManager( 2381): 100% TOTAL: 54% user + 28% kernel + 15% iowait + 0.9% softirq
W/ActivityManager( 2381):   Force finishing activity com.android.myapp/.MainActivity
W/audio_hw_primary( 2282): start_output_stream...
W/audio_hw_primary( 2282): headphone 8 ,headset 0 ,speaker 0, earpiece 0, 
W/audio_hw_primary( 2282): card 0, port 0 device 8
I/ActivityManager( 2381): Killing ProcessRecord{41316378 7704:com.android.myapp/10043}: user's request
I/WindowManager( 2381): WIN DEATH: Window{41319d40 com.android.myapp/com.android.myapp.MainActivity paused=true}
I/ActivityManager( 2381): Process com.android.myapp (pid 7704) has died.
W/InputManagerService( 2381): Got RemoteException sending setActive(false) notification to pid 7704 uid 10043
D/dalvikvm( 2454): GC_FOR_ALLOC freed 294K, 82% free 7775K/41799K, paused 44ms
I/dalvikvm-heap( 2454): Grow heap (frag case) to 17.027MB for 9830416-byte allocation
D/dalvikvm( 2454): GC_CONCURRENT freed 4K, 59% free 17370K/41799K, paused 4ms+8ms
W/audio_hw_primary( 2282): do_out_standby...
D/dalvikvm( 2454): GC_FOR_ALLOC freed 0K, 59% free 17370K/41799K, paused 26ms
I/dalvikvm-heap( 2454): Grow heap (frag case) to 38.884MB for 22924816-byte allocation
D/dalvikvm( 2454): GC_CONCURRENT freed 0K, 5% free 39758K/41799K, paused 3ms+6ms
I/ActivityManager( 2381): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=org.jtb.alogcat cmp=org.jtb.alogcat/.LogActivity bnds=[528,94][624,190]} from pid 2560
Charles
  • 50,943
  • 13
  • 104
  • 142
Ron
  • 22,128
  • 31
  • 108
  • 206

1 Answers1

2

ANR means Activity Not Responding. So basically, your application is too busy to tell Android that it is still alive.

What you could do, is look into AsyncTask and start another thread.
This way you dont block the whole activity, and tasks can be executed asynchronous.

If that doesn't help, you might have some memory leak problems as Neron T noticed above.
This video helped me a lot while struggling with memory leaks.

bryanph
  • 993
  • 7
  • 18
  • the thing is that calling a new activity async doesn't make that much sense, does it? and the real problem is that my player stops... i need to fix this – Ron Jun 12 '13 at 09:08