Unwilling EditText onTouchListener Function Call [duplicate]

眉间皱痕 提交于 2019-12-01 21:08:43

The double call is because the touch listener fires twice (at least!), once for when the finger lands on the EditText (ACTION_DOWN) and once when you lift the finger (ACTION_UP). To fix it, just make sure you only activate on one case. Alternatively, you could just set an onClick listener instead.

      public boolean onTouch(View v, MotionEvent event) {
            if (event.getAction() == MotionEvent.ACTION_UP) {
              inflatePopUpOdemeSekli();
            }

            return false;
      }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!