#How differentiate "setOnClickListener" & "setOnTouchListener"

44 messages ยท Page 1 of 1 (latest)

late drum
#

Hello, does anybody know how to detect either the setOnClickListener or either the setOnTouchListener ?

normal juncoBOT
#

โŒ› This post has been reserved for your question.

Hey @late drum! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

hallow kayak
#

are you asking how to implement them?

late drum
#

but i want only the setOnClickListener

hallow kayak
#

I don't see why you would do that. if you don't want to use the method, just don't implement it?

late drum
#

and also, when it touch my phone for a moment and move it on the left and right, both events are started, but i would like only the setOnTouchListener

#

@hallow kayak

#

^^

hallow kayak
#

then only use that method

late drum
#

No I can't

#

I'll use deepl

#

wait

#

when I click on my phone, I want only the setOnClickListener event to run, because I want to do a certain action.
but when I drag my finger on my screen, I only want the setOnTouchListener event to fire, because I want to do another action.
But both events are launched whether I click or touch the screen

#

@hallow kayak

cloud fog
#

this feels like a

normal juncoBOT
late drum
#

that's why i use those events

normal juncoBOT
#

๐Ÿ’ค Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.

late drum
#

Someone can help me ?

tiny kettle
#

don't set any listeners through setOnTouchListener

#

if you don't want it to been called

late drum
#

I want to call them

tiny kettle
#

but i want only the setOnClickListener

late drum
#

when I click on my phone, I want only the setOnClickListener event
and when I drag my finger on my screen, I only want the setOnTouchListener

#

I want to use two events "separately"

tiny kettle
late drum
#

what does the drag listener do ?

tiny kettle
#

Register a drag event listener callback object for this View. The parameter is an implementation of View.OnDragListener. To send a drag event to a View, the system calls the View.OnDragListener.onDrag(View, DragEvent) method.

late drum
#

i'll look on it thanks ^^

normal juncoBOT
# late drum i'll look on it thanks ^^

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.

tiny kettle
#

np ๐Ÿ˜‰

late drum
tiny kettle
# late drum Ok I have check, and i don't think this is what i need, because i'm coding a tet...

according to docs, DragEvent has different states, like ACTION_DRAG_STARTED, where you can get x and y of the point from where drag was started, so you can figure out user dragging the block or not; ACTION_DROP - Action constant returned by getAction(): Signals to a View that the user has released the drag shadow.
Thus, imo, it suits to your problem. But maybe you should ask os server dedicated to android development

late drum
late drum
#

Np :p thank you for your time ^^

normal juncoBOT
# late drum Np :p thank you for your time ^^

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.

tiny kettle