开发者

How to emulate double tap on one tap?

开发者 https://www.devze.com 2023-02-19 08:59 出处:网络
For example mainEdit.setOnClickListener(new OnClickListener() { int i = 0; public void onClick(View v) {

For example

   mainEdit.setOnClickListener(new OnClickListener() {  
        int i = 0;
            public void onClick(View v) {
                //here something 开发者_StackOverflowthat causing double tap event
            }
        });

How can i archive that?


Android doesn't support double tap by default. You can kind of get the same effect by using a normal OnClickListener that stores a timestamp and checks to see if the stored value is close enough to the current time to count as a double click. You could even make your own Listener class that behaves this way. But I am unsure what you mean when you say: "here something that causing double tap event" Since nothing in android responds to double taps by default.

0

精彩评论

暂无评论...
验证码 换一张
取 消