注册LongClick监听器上搜索栏 [英] Register LongClick listener on a Seekbar

查看:208
本文介绍了注册LongClick监听器上搜索栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android的,有可能是我在搜索栏注册一个长按监听?

In android, is it possible for me to register a long click listener on a seekbar?

我已经这样做了:

mySeekBar.setLongClickable(true);
mySeekBar.setOnLongClickListener(new OnLongClickListener() {
   public boolean onLongClick (View v) {
    Log.d("TEST", "Get a long click event!!!!!!!!!!!!");
 }
});

但我看不到我的调试print语句的。关于我如何能实现它的主意?

But I don't see my debug print statement at all. Any idea about how can I achieve it?

感谢您。

推荐答案

AFAICT这是不可能与 OnLongClickListener 做的。该文档不说,它的不会的工作,但我从来没有见过这样的例子(我从来没有得到它要么工作我自己)。

AFAICT this is not possible to do with the OnLongClickListener. The documentation doesn't say it won't work, but I've never seen any example of this (and I never got it to work myself either).

一个可能的解决方法(取决于你想要达到什么)可以使用 OnSeekBarChangeListener onStartTrackingTouch / onStopTrackingTouch 回调。

A possible workaround (depending on what you want to achieve) could be to use the OnSeekBarChangeListener handling the long click through onStartTrackingTouch / onStopTrackingTouch callbacks.

这篇关于注册LongClick监听器上搜索栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆