针对touchlistener 安卓的java避免空指针异常
我希望避免以下情况的空指针异常
我想禁用相对布局的触控侦听器
private RelativeLayout container ;
container.setOnTouchListener(null);
多谢各位
你可以在下面搜索框中键入要查询的问题!
我希望避免以下情况的空指针异常
我想禁用相对布局的触控侦听器
private RelativeLayout container ;
container.setOnTouchListener(null);
多谢各位
# 1 楼答案
禁用您的RelativeLayout,以便不会触发触摸事件。使用