复现步骤:
在app启动后如果不稍微等待直接点击侧栏的收藏的话有极大的概率crash
设备:
Android 11 LineageOS 18.1 lenovo k10
log:
03-15 12:22:52.608 4208 4208 E AndroidRuntime: FATAL EXCEPTION: main
03-15 12:22:52.608 4208 4208 E AndroidRuntime: Process: org.mewx.wenku8, PID: 4208
03-15 12:22:52.608 4208 4208 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setVisibility(int)' on a null object reference
03-15 12:22:52.608 4208 4208 E AndroidRuntime: at hr$b.b(Unknown Source:176)
03-15 12:22:52.608 4208 4208 E AndroidRuntime: at hr$b.onPostExecute(Unknown Source:2)
03-15 12:22:52.608 4208 4208 E AndroidRuntime: at android.os.AsyncTask.finish(AsyncTask.java:771)
03-15 12:22:52.608 4208 4208 E AndroidRuntime: at android.os.AsyncTask.access$900(AsyncTask.java:199)
03-15 12:22:52.608 4208 4208 E AndroidRuntime: at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)
03-15 12:22:52.608 4208 4208 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
03-15 12:22:52.608 4208 4208 E AndroidRuntime: at android.os.Looper.loop(Looper.java:223)
03-15 12:22:52.608 4208 4208 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7660)
03-15 12:22:52.608 4208 4208 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
03-15 12:22:52.608 4208 4208 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
03-15 12:22:52.608 4208 4208 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
复现步骤: 在app启动后如果不稍微等待直接点击侧栏的收藏的话有极大的概率crash 设备: Android 11 LineageOS 18.1 lenovo k10 log: 03-15 12:22:52.608 4208 4208 E AndroidRuntime: FATAL EXCEPTION: main 03-15 12:22:52.608 4208 4208 E AndroidRuntime: Process: org.mewx.wenku8, PID: 4208 03-15 12:22:52.608 4208 4208 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setVisibility(int)' on a null object reference 03-15 12:22:52.608 4208 4208 E AndroidRuntime: at hr$b.b(Unknown Source:176) 03-15 12:22:52.608 4208 4208 E AndroidRuntime: at hr$b.onPostExecute(Unknown Source:2) 03-15 12:22:52.608 4208 4208 E AndroidRuntime: at android.os.AsyncTask.finish(AsyncTask.java:771) 03-15 12:22:52.608 4208 4208 E AndroidRuntime: at android.os.AsyncTask.access$900(AsyncTask.java:199) 03-15 12:22:52.608 4208 4208 E AndroidRuntime: at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788) 03-15 12:22:52.608 4208 4208 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106) 03-15 12:22:52.608 4208 4208 E AndroidRuntime: at android.os.Looper.loop(Looper.java:223) 03-15 12:22:52.608 4208 4208 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7660) 03-15 12:22:52.608 4208 4208 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 03-15 12:22:52.608 4208 4208 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 03-15 12:22:52.608 4208 4208 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)