OnTouch is called when a touch event is dispatched to a view it allows listeners to get a chance to respond before the target view. It gives a motion event.
Questions tagged [ontouch]
274 questions
1
vote
0 answers
Emulating touch
We are trying to make a simple TeamViewer type application, where a touch on the local device will be emulated on the remote device.
So how can the touch be emulated on the remote device ?
Conditions applied :
No root access
If emulating is not…

user10347769
- 95
- 2
1
vote
2 answers
View not moving with finger with onTouchListener
I'm trying to make a View's x value move along with a finger as it drags across the screen. Although the view moving is smooth, it only moves ~1/3 of the distance that the finger does. The View in my case happens to be a RecyclerView, but I think…

Gregory Conrad
- 1,324
- 11
- 19
1
vote
0 answers
Custom View onTouch does not respond
I have on the MainActivity:
setContentView(R.layout.activity_main);
the layout is:

Drocchio
- 383
- 4
- 21
1
vote
1 answer
How can I move an image based on a user's touch?
I am trying to get an image to move, either to the Left Or Right, when the user touches either the Left Or Right of their device's screen. I have the following code....I have run the Emulator, in Android Studio, and when I click on the Right or Left…

Laurelton Studios
- 129
- 13
1
vote
1 answer
Which Code To Add To Make An Image Move?
Which code should I put in the comment in the following OnTouch function so that the image, CIRCLE1, moves to the right or left when the right or left part of the screen is touched? As you can see I tried to use
float X = ImageView.getX(); X++;…

Laurelton Studios
- 129
- 13
1
vote
1 answer
How to use OnTouchEvent Correctly?
How would I use the OnTouchEvent function to make an ImageView move to the right or left when the user touches the right or left of the screen? The following code is what I have tried. What could I do to improve this and make it work?
ImageView…

Laurelton Studios
- 129
- 13
1
vote
1 answer
Android OnTouch Listener Doesn't work when App is on Release mode
In one of my Activities, I have an ImageView which I set to it onTouchListener, in order to move it on the screen, the problem is that when I test it on debug mode everything works fine and I see that the ImageView is moving on the screen and I also…

Elior
- 3,178
- 6
- 37
- 67
1
vote
0 answers
Wrong coordinates when drawing OnTouch lines on ImageView using canvas
Thank you in advice for your help!
I am trying to make a simple application to draw lines on a ImageView usings OnTouch tap detection and path and bitmap painting
Tell me please where i did a mistake with the coordinates i take un OnTouch
Probably…

Sergey Penkin
- 11
- 3
1
vote
0 answers
DatePicker: event when I remove my finger
I want to do some actions when I change the date in a DatePicker, but this actions I want to be performed only when I remove the finger from the DatePicker (last date chosen), so the OnDateChangedListener() is not useful for me.
So I thought that an…

Tonet
- 11
- 5
1
vote
0 answers
Implement ondraglister on an imageview inside Viewpager inside collapsibletoolbar inside appbarlayout
Has anyone tried to implement an ondrag listener on an imageview inside Viewpager inside collapsibletoolbar inside appbarlayout. The ondrag method is not being called in the ontouchlistener.I tried it for viewpager and appbarlayout.
I need to…

user3750465
- 56
- 3
1
vote
1 answer
Ontouch Listener on Custom View
I have a custom view that can be dragged around the screen and when tapped it will display another view, everything works fine when it is used in the emulator. But when on a real device the custom view does not show the new view on click. And I am…

Gionne Lapuz
- 518
- 1
- 9
- 23
1
vote
1 answer
Android stop drag out of screen from center point of View
Image showing intended result
Is there a way to stop the center point of a view from dragging off the screen using onTouch move events?
I can detect the point but I need the logic to stop the view moving and then re-joining the drag when the user…

Ashley Lidgett
- 23
- 1
- 5
1
vote
1 answer
how to draw and erase on touch in android
I have got no answer for this question on the internet , I'm trying to paint with different colors which the user can choose from , the problem is this drawview is not drawing anything and i don't know how o ad an on touch eraser to erase only the…

rgl
- 45
- 8
1
vote
1 answer
[Android]onTouch in child View is not responding
I have been working on making Sudoku grid whose cell's value changes whenever I touch on a cell. So I have implemented this sudoku grid in a LinearLayout by Child View, and tried using OnTouch method, but it is not working. I tried using log method…

SnackerH
- 11
- 2
1
vote
0 answers
ACTION_UP not working but ACTION_DOWN is
My code is meant to play the specified frequency and wave form when the button is pressed and stop playing when its released however the sound does not stop when the button is released, any help would be useful:
public boolean onTouch(View v,…

Jackington
- 127
- 10