问题
The app is running with Marshmallow. With the app open, I switched to "Setting>Apps>MyApp>Permissions" to toggle the permissions and when switching back to the app, it crashes. From the logcat, I found these lines:
01-18 14:45:35.456 799-1158/? I/ActivityManager? Killing 23531:ca.bluecross.ab.sys1/u0a103 (adj 9): permissions revoked
01-18 14:45:35.476 799-1632/? I/WindowState? **WIN DEATH:** Window{20182a4 u0 ca.bluecross.ab.sys1/myexample.com.view.activities.eclaims.AuditActivity}
01-18 14:45:35.476 799-1600/? D/GraphicsStats? Buffer count: 6
01-18 14:45:35.477 799-894/? W/InputDispatcher? channel 'd9c6d5e myexample.com.sys1/myexample.com.view.activities.MainActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
01-18 14:45:35.477 799-894/? E/InputDispatcher? channel 'd9c6d5e myexample.com.sys1/myexample.com.view.activities.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
01-18 14:45:35.478 799-1160/? I/WindowState? **WIN DEATH:** Window{d9c6d5e u0 myexample.com.sys1/myexample.com.view.activities.MainActivity}
01-18 14:45:35.478 799-1160/? W/InputDispatcher? Attempted to unregister already unregistered input channel 'd9c6d5e myexample.com.sys1/myexample.com.view.activities.MainActivity (server)'
01-18 14:45:35.484 799-1600/? W/ActivityManager? Spurious death for ProcessRecord{5c56227 0:myexample.com.sys1/u0a103}, curProc for 23531: null
What do those WIN DEATHin the logcat mean? Is Android OS killing my app?
回答1:
In my case I solved it by remove custom progress bar. It loaded when fragment start, but after restore from background and switch permissions it crashed on progressbar.dismiss()
P.S. custom progressbar: SVProgressHUD
来源:https://stackoverflow.com/questions/34865719/android-6-permission-crashes-when-toggling-permission-in-setting-and-go-back-t