GSYVideoPlayer icon indicating copy to clipboard operation
GSYVideoPlayer copied to clipboard

项目中出现了空指针异常

Open coolxtc opened this issue 8 years ago • 1 comments

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setImageResource(int)' on a null object reference at com.shuyu.gsyvideoplayer.utils.OrientationUtils$1.onOrientationChanged(OrientationUtils.java) at android.view.OrientationEventListener$SensorEventListenerImpl.onSensorChanged(OrientationEventListener.java:143) at android.hardware.SystemSensorManager$SensorEventQueue.dispatchSensorEvent(SystemSensorManager.java:496) at android.os.MessageQueue.nativePollOnce(MessageQueue.java) at android.os.MessageQueue.next(MessageQueue.java:330) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5546) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)

经查看源码后发现是OrientationUtils里面的 gsyVideoPlayer.getFullscreenButton().setImageResource(gsyVideoPlayer.getShrinkImageRes()); 没有判空导致

coolxtc avatar Mar 27 '18 01:03 coolxtc

好的,收到问题

CarGuo avatar Mar 27 '18 02:03 CarGuo