android 吐司暂停了但是程序没有崩,Toast消失后应用程序崩溃

我有一个从互联网播放流的android应用程序。当没有流媒体播放时,应用程序应该显示一个Toast的消息:“无法播放视频”,屏幕应该是黑色的。当在4.2 Android盒子上试用这些应用程序时,一切都可以,但是在4.4安卓盒子上,Toast消失后应用程序崩溃。 这是显示吐司代码:Toast消失后应用程序崩溃

public void setOnErrorListener(){

OnErrorListener oel = new OnErrorListener(){

@Override

public boolean onError(MediaPlayer arg0, int arg1, int arg2) {

log.i("TiboVideoView-","error");

//catchupVideoView.unlockPlayer();

//Toast.makeText(context,context.getString(R.string.videoerror), Toast.LENGTH_LONG).show();

nowPlayingDate.setTime(standartTime.getTime());

nextPlayingDate = null;

try {

if (isPlaying()) {

try {

stopPlayback();

} catch (Exception f) {

}

}

} catch (Exception g) {

}

try{

handler.post(LOG_CHANNEL_LOGS);

}

catch(Exception e)

{

e.printStackTrace();

}

try

{

Toast.makeText(context,context.getString(R.string.videoerror), Toast.LENGTH_LONG).show();

}

catch(Exception e)

{

e.printStackTrace();

}

return true;

}

};

super.setOnErrorListener(oel);

}

这是logcat的输出:

05-26 10:02:27.316 E/MediaPlayer(2047): Error (-32,0)

05-26 10:02:27.316 D/VideoView(2047): Error: -32,0

05-26 10:02:27.316 I/hide (2047): 8

05-26 10:02:27.316 I/TiboVideoView-(2047): error

05-26 10:02:27.316 D/AndroidRuntime(2047): Shutting down VM

05-26 10:02:27.316 W/dalvikvm(2047): threadid=1: thread exiting with uncaught exception (group=0x41728ba8)

05-26 10:02:27.316 E/NotificationService( 516): Package has already posted 50 toasts. Not showing more. Package=com.tibo.webtv

05-26 10:02:27.316 E/NotificationService( 516): Package has already posted 50 toasts. Not showing more. Package=com.tibo.webtv

05-26 10:02:27.326 I/Process (2047): Sending signal. PID: 2047 SIG: 9

05-26 10:02:27.326 E/AndroidRuntime(2047): FATAL EXCEPTION: main

05-26 10:02:27.326 E/AndroidRuntime(2047): Process: com.tibo.webtv, PID: 2047

05-26 10:02:27.326 E/AndroidRuntime(2047): java.util.concurrent.RejectedExecutionException: Task [email protected] rejected from [email protected][Running, pool size = 9, active threads = 9, queued tasks = 128, completed tasks = 36]

05-26 10:02:27.326 E/AndroidRuntime(2047): at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2011)

05-26 10:02:27.326 E/AndroidRuntime(2047): at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:793)

05-26 10:02:27.326 E/AndroidRuntime(2047): at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1339)

05-26 10:02:27.326 E/AndroidRuntime(2047): at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:590)

05-26 10:02:27.326 E/AndroidRuntime(2047): at com.tibo.webtv.catchup.am.run(Unknown Source)

05-26 10:02:27.326 E/AndroidRuntime(2047): at android.os.Handler.handleCallback(Handler.java:733)

05-26 10:02:27.326 E/AndroidRuntime(2047): at android.os.Handler.dispatchMessage(Handler.java:95)

05-26 10:02:27.326 E/AndroidRuntime(2047): at android.os.Looper.loop(Looper.java:136)

05-26 10:02:27.326 E/AndroidRuntime(2047): at android.app.ActivityThread.main(ActivityThread.java:5017)

05-26 10:02:27.326 E/AndroidRuntime(2047): at java.lang.reflect.Method.invokeNative(Native Method)

05-26 10:02:27.326 E/AndroidRuntime(2047): at java.lang.reflect.Method.invoke(Method.java:515)

05-26 10:02:27.326 E/AndroidRuntime(2047): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788)

05-26 10:02:27.326 E/AndroidRuntime(2047): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:604)

05-26 10:02:27.326 E/AndroidRuntime(2047): at dalvik.system.NativeStart.main(Native Method)

05-26 10:02:27.326 W/ActivityManager( 516): Force finishing activity com.tibo.webtv/.catchup.CatchupActivity

05-26 10:02:27.426 D/ActivityManager( 516): send app_CRASH broadcast, packageName:com.tibo.webtv

05-26 10:02:27.426 W/InputDispatcher( 516): channel '41b17380 com.tibo.webtv/com.tibo.webtv.catchup.CatchupActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9

05-26 10:02:27.426 E/InputDispatcher( 516): channel '41b17380 com.tibo.webtv/com.tibo.webtv.catchup.CatchupActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

05-26 10:02:27.426 W/InputDispatcher( 516): channel '41c803b0 Toast (server)' ~ Consumer closed input channel or an error occurred. events=0x9

05-26 10:02:27.426 E/InputDispatcher( 516): channel '41c803b0 Toast (server)' ~ Channel is unrecoverably broken and will be disposed!

05-26 10:02:27.426 W/InputDispatcher( 516): Attempted to unregister already unregistered input channel '41b17380 com.tibo.webtv/com.tibo.webtv.catchup.CatchupActivity (server)'

05-26 10:02:27.426 W/InputDispatcher( 516): Attempted to unregister already unregistered input channel '41c803b0 Toast (server)'

05-26 10:02:27.426 I/ActivityManager( 516): Process com.tibo.webtv (pid 2047) has died.

05-26 10:02:27.426 I/WindowState( 516): WIN DEATH: Window{41c44f98 u0 com.tibo.webtv/com.tibo.webtv.MainActivity}

05-26 10:02:27.426 W/ContextImpl( 516): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1162 com.android.server.am.ActivityManagerService.onVideoPlayerCrashed:3700 com.android.server.am.ActivityManagerService.handleAppDiedLocked:3730 com.android.server.am.ActivityManagerService.appDiedLocked:3868 com.android.server.am.ActivityManagerService$AppDeathRecipient.binderDied:1046

05-26 10:02:27.426 I/WindowState( 516): WIN DEATH: Window{41b17380 u0 com.tibo.webtv/com.tibo.webtv.catchup.CatchupActivity}

05-26 10:02:27.426 I/WindowState( 516): WIN DEATH: Window{41c803b0 u0 Toast}

05-26 10:02:27.426 I/WindowState( 516): WIN DEATH: Window{41beb378 u0 SurfaceView}

05-26 10:02:27.436 I/ActivityManager( 516): Start proc com.tibo.webtv for activity com.tibo.webtv/.MainActivity: pid=2235 uid=10058 gids={50058, 3003, 1028, 1015}

05-26 10:02:27.536 D/dalvikvm(2235): GC_CONCURRENT freed 217K, 26% free 710K/952K, paused 1ms+0ms, total 5ms

05-26 10:02:27.566 D/dalvikvm( 516): GC_CONCURRENT freed 1407K, 26% free 6296K/8484K, paused 2ms+6ms, total 55ms

05-26 10:02:27.566 D/dalvikvm( 516): WAIT_FOR_CONCURRENT_GC blocked 38ms

05-26 10:02:27.586 D/dalvikvm(2235): GC_CONCURRENT freed 178K, 18% free 948K/1152K, paused 0ms+4ms, total 9ms

05-26 10:02:27.736 D/dalvikvm(2235): GC_CONCURRENT freed 192K, 16% free 1149K/1368K, paused 2ms+2ms, total 10ms

05-26 10:02:27.916 D/dalvikvm( 516): GC_CONCURRENT freed 1350K, 27% free 6276K/8484K, paused 1ms+6ms, total 42ms

05-26 10:02:27.956 D/dalvikvm(2235): GC_FOR_ALLOC freed 21K, 11% free 1222K/1368K, paused 4ms, total 4ms

05-26 10:02:27.966 I/dalvikvm-heap(2235): Grow heap (frag case) to 10.004MB for 9216016-byte allocation

05-26 10:02:27.976 D/dalvikvm(2235): GC_CONCURRENT freed <1K, 2% free 10222K/10372K, paused 0ms+1ms, total 4ms

05-26 10:02:28.066 D/TextLayoutCache(2235): Using debug level = 0 - Debug Enabled = 0

05-26 10:02:28.126 W/Settings(2235): Setting wifi_sleep_policy has moved from android.provider.Settings.System to android.provider.Settings.Global, value is unchanged.

05-26 10:02:28.136 W/ActivityThread(2235): ClassLoader.loadClass: The class loader returned by Thread.getContextClassLoader() may fail for processes that host multiple applications. You should explicitly specify a context class loader. For example: Thread.setContextClassLoader(ge

tClass().getClassLoader());

有谁知道为什么会出现这种情况?

+0

你可以发表一些代码吗?你有多少任务开始?没有吐司应用程序崩溃? –

+0

你能告诉我们你的代码吗? –

+0

你在做什么流式传输?分享一些可能的代码 –

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值