You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
报错信息:
java.lang.RuntimeException: StrictMode ThreadPolicy violation
at android.os.StrictMode$AndroidBlockGuardPolicy.onThreadPolicyViolation(StrictMode.java:1875)
at android.os.StrictMode$AndroidBlockGuardPolicy.lambda$handleViolationWithTimingAttempt$0$android-os-StrictMode$AndroidBlockGuardPolicy(StrictMode.java:1789)
at android.os.StrictMode$AndroidBlockGuardPolicy$$ExternalSyntheticLambda1.run(Unknown Source:6)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7898)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Caused by: android.os.strictmode.DiskReadViolation
at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1658)
at libcore.io.BlockGuardOs.access(BlockGuardOs.java:74)
at libcore.io.ForwardingOs.access(ForwardingOs.java:128)
at android.app.ActivityThread$AndroidOs.access(ActivityThread.java:7775)
at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:332)
at java.io.File.exists(File.java:829)
at android.app.ContextImpl.getDataDir(ContextImpl.java:2962)
at android.app.ContextImpl.getPreferencesDir(ContextImpl.java:704)
at android.app.ContextImpl.getSharedPreferencesPath(ContextImpl.java:931)
at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:553)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:217)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:217)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:217)
at com.scwang.smart.refresh.header.ClassicsHeader.(ClassicsHeader.java:236)
at com.scwang.smart.refresh.header.ClassicsHeader.(ClassicsHeader.java:76)
The text was updated successfully, but these errors were encountered:
报错原因: ClassicsHeader类内236行调用了getSharedPreferences,应该改为在子线程调用。
报错信息:
java.lang.RuntimeException: StrictMode ThreadPolicy violation
at android.os.StrictMode$AndroidBlockGuardPolicy.onThreadPolicyViolation(StrictMode.java:1875)
at android.os.StrictMode$AndroidBlockGuardPolicy.lambda$handleViolationWithTimingAttempt$0$android-os-StrictMode$AndroidBlockGuardPolicy(StrictMode.java:1789)
at android.os.StrictMode$AndroidBlockGuardPolicy$$ExternalSyntheticLambda1.run(Unknown Source:6)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7898)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Caused by: android.os.strictmode.DiskReadViolation
at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1658)
at libcore.io.BlockGuardOs.access(BlockGuardOs.java:74)
at libcore.io.ForwardingOs.access(ForwardingOs.java:128)
at android.app.ActivityThread$AndroidOs.access(ActivityThread.java:7775)
at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:332)
at java.io.File.exists(File.java:829)
at android.app.ContextImpl.getDataDir(ContextImpl.java:2962)
at android.app.ContextImpl.getPreferencesDir(ContextImpl.java:704)
at android.app.ContextImpl.getSharedPreferencesPath(ContextImpl.java:931)
at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:553)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:217)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:217)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:217)
at com.scwang.smart.refresh.header.ClassicsHeader.(ClassicsHeader.java:236)
at com.scwang.smart.refresh.header.ClassicsHeader.(ClassicsHeader.java:76)
The text was updated successfully, but these errors were encountered: