New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
將App從背景移除時,會發生錯誤 #113
Comments
這是我的AndroidManifest.xml檔案
|
@ArthurPai 你已经找到原因,那么就在
|
@Jacksgong 我的疑惑是當主線程被kill掉以後,那麼Service重新啟動時, |
Android中,每个进程都有自己的 |
@Jacksgong 我剛剛測試將init()從MainActivity#onCreate移到Application#onCreate就解決了。 感謝,從你這裡學到好多~~~^^ |
@ArthurPai 是的。OK. |
我現在做一個Unity3D的檔案背景下載的Plugin,底層使用這個Library來做
最後會輸出成一個jar檔讓Unity3D載入
現在已經可以正常add/pause檔案下載
目前遇到一個問題,當App進入背景後,我再手動將App從背景移除,
會發生下面的錯誤訊息
Android的畫面上也會跳出 "很抱歉,程式已停止" 的Error Dialog
看Log Trace感覺像是Service跟著App一起被移除,然後又被自動重新啟動(START_STICKY)
這時好像Application Context是null,結果跳出NullPointerException
請問一下,這邊該如何處理?
The text was updated successfully, but these errors were encountered: