2012-01-03 130 views
0

我的Activty啓動服務。 (該服務播放媒體流,但無論如何)。 如果我得到了後退鍵,在我的活動中,該服務會被殺死。
服務是不是有界。當按下時服務被殺死

這裏堆棧跟蹤:

01-03 19:01:45.621:d/PlayerActivity(27221):按鈕點擊
01-03 19:01:45.625:d/PlayerActivity(27221): haveInternet =真
01-03 19:01:45.636:d/PlayerActivity(27221):播放
01-03 19:01:45.640:d/PlayerService(27221):的onCreate服務
01-03 19:01 :45.640:I/PlayerService(27221):收到開始ID 1:意圖{cmp = de.arvidg.onlineradio/.PlayerService}
01-03 19:01:45.644: d/PlayerService(27221):setAudiotStreamType
01-03 19:01:45.718:I/AwesomePlayer(已123):setDataSource_l( 'http://listen.technobase.fm/tunein-dsl-pls')
01-03 19:01:45.718 D/PlayerService(27221):setDataSource
01-03 19:01:45.718:D/PlayerService(27221):prepareAsync
01-03 19:01:45.718:D/PlayerService (27221):onStartCommand
01-03 19:01:45.765:V/ChromiumHTTPDataSource(123):代表uid連接10058
01-03 19:01:45.765:I/ChromiumHTTPDataSource(123):連接到http://listen.technobase.fm/tunein-dsl-pls @ 0
01-03 19:01:5 0.078:D/PlayerService(27221):onPrepared
01-03 19:01:50.093:D/AudioHardware(123):AudioHardware pcm播放正在退出待機狀態。
01-03 19:01:50.093:d/AudioHardware(123):openPcmOut_l()mPcmOpenCnt:0
01-03 19:05:44.996:d/PlayerActivity(27221):的onPause
01-03 19: 05/44.996:D/PlayerActivity(27221):mpState = 1 01-03 19:05:45.070:W/InputManagerService(193):在非焦點客戶端上啓動輸入com.android.internal.view.IInputMethodClient $ Stub $ Proxy @ 4169d040(uid = 10058 pid = 27221) 01-03 19:05:45.672:I/ActivityManager(193):不再需要de.arvidg.onlineradio(pid 27221):隱藏#1
01-03 19 :05:45.703:W/ActivityManager(193):計劃重新啓動崩潰的服務de.arvidg.onlineradio/.PlayerService in 480134ms
01-03 19:05:45.703:I/WindowManager(193): WIN DEATH:窗口{416e3580 de.arvidg.onlineradio/de.arvidg.onlineradio.StartActivity paused = false}
01-03 19:05:45.707:W/TimedEventQueue(123):事件238未在隊列中找到,已經取消?
01-03 19:05:45.707:W/AudioFlinger(123):會話ID 165找不到PID 123
01-03 19:05:48.711:D/AudioHardware(123):AudioHardware pcm回放將要支持。
01-03 19:05:48.711:D/AudioHardware(123):closePcmOut_l()mPcmOpenCnt:1
01-03 19:05:55.691:W/ActivityManager(193):ActivityRecord的活動銷燬超時{416d47d8 de wlan0:WPA:使用14:d6:4d:cb:2f:44完成組更新[GTK = TKIP] .arvidg.onlineradio/.StartActivity}
01-03 19:05:56.332:I/wpa_supplicant(434)
01-03 19:06:41。515:d/dalvikvm(193):GC_CONCURRENT釋放1473K,23%免費16567K/21511K,暫停21ms + 9ms的

什麼是AwesomePlayer?!它的不是我的標籤... 任何人都可以幫忙嗎?它使我瘋狂,我無法得到它的工作,因爲2天...

+0

解決它自己。 setForeground()! – Leandros 2012-01-03 19:54:19

+0

[Android後臺服務重新啓動時應用程序被終止]可能的重複(http://stackoverflow.com/questions/15452935/android-background-service-is-restarting-when-application-is-killed) – Carpetsmoker 2016-08-26 20:34:53

回答

0

解決它自己,與setForeground()

相關問題