我正在使用一个名为 MBWheelPicker 开源类的 Wheel 选择器,它扩展了 View 并具有几个接口 OnScrollChangeListener 和 OnItemSelectedListener。当用户在向wheelpicker 输入输入时暂停应用程序并返回时,onchangelistener 在选择器视图的 OnDraw 方法中变为 null 并引发除以零异常。
这是构造函数的片段:
public MBWheelPicker(Context){
this(context, null)
}
public MBWheelPicker(Context context, AttributeSet attrs){
super(context, attrs)
//here initialize TypedArray other Styleable stuff in the xml
}
那时我的应用程序崩溃了。我不能包含该类的全部代码,因为它有数百行代码。我该如何解决这个问题?
两个监听器都是嵌套在 WheelPicker 类本身中的接口。