注册LongClick监听器上搜索栏 [英] Register LongClick listener on a Seekbar
问题描述
在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 $ C处理长按$ C> /
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屋!