Questions tagged [android-touch-event]

For questions about detecting, handling and responding to touch events in a view, in the Android platform.

Use this tag for questions related to detecting, handling and responding to touch events in a view, in the Android platform.

Documentation:

190 questions
0
votes
3 answers

Touch to image view not working

I've made a simple app in which I am using 3 tabs. Each tab is having separate classes and layouts. First tab shows map. Second tab will show the camera from which the user can take picture(s) and third tab is off Pictures in which the captured…
0
votes
0 answers

How to get button id from draglistener in android

I am developing an android app using drag and drop. when i drag a button. then i want to identify the button by name (get the button name). I want to get the button name in DragEvent.ACTION_DROP. My code is shown below. drop.setOnDragListener(new…
user7364622
0
votes
1 answer

MotionEvents triggering no matter what in Android

I have this code for my MotionEvents in Android: @Override public boolean onTouchEvent(MotionEvent event){ int action = event.getActionMasked(); switch (action){ case MotionEvent.ACTION_UP: mGameview.moveUp(30); …
moxide
  • 65
  • 1
  • 6
0
votes
1 answer

Pass data of touch event from custom view to activity android

How do I pass data from custom view to parent activity? I've data of which box is touched in the custom view. I want to pass that data to the parent activity whenever a box is touched. Here's my activity layout: 1 Edit: Here's parent activity:…
0
votes
1 answer

touch events aren't disabled in android webview

I'm trying to disable touch events on webview, this is what I did webview.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { Log.info("webview", "onTouch is called"); …
hixhix
  • 771
  • 7
  • 23
0
votes
2 answers

Simulate Touch event on EditText to show soft keyboard

I have a invisible EditText: ReplyInput and a button: ShowReply. I want to show the ReplyInput and the soft keyboard after ShowReply is clicked. Anyone has any idea about that? Thank for reading :)
0
votes
3 answers

can i access resources or views of fragment inside its baseactivity

I have a base activity in which i have inflated 4 fragments. i have several methods which i have to use in all the fragments.but i don't want that. I want to implement that method inside my base activity so that i can reuse my method to all the…
0
votes
1 answer

How do I aquire touch coordinates for touches outside and inside my app?

I am building an app that needs to get screen cooordinates for any part clicked, both inside and outside my app.Also if possible it may give information about how many pointers are involved in the touch event.My device is rooted.
John
  • 86
  • 10
0
votes
4 answers

Trigger ACTION_POINTER_DOWN event programmatically

want to trigger on two fingers down event for a few milliseconds. I am able to trigger simple touch event by using this code: objImageView.getLocationOnScreen(coords); int xa = coords[0]; int ys =…
Syeda Zunaira
  • 5,191
  • 3
  • 38
  • 70
0
votes
1 answer

Does an OnClickListener take into account the scaling factor of the view?

I have a CustomLayout view that extends TableLayout and contains LinearLayout row children, each of them containing a RelativeLayout cell (each individual cell having an OnClickListener). The CustomLayout also has a ScaleGestureDetector present and…
0
votes
1 answer

How to dispatch touchevent from popupwindow to its child listview

I'm using a PopupWindow to show some suggestions when user type on an edittext. inside the popup window, i have a listview which shows the suggestions. i couldn’t use ListpopupWindow because it was covering the keyboard thus the user can't be able…
Edijae Crusar
  • 3,473
  • 3
  • 37
  • 74
0
votes
1 answer

RecyclerView not getting touch events because there is another LinearLayout above (sometimes)

I have a RecyclerView that gets touch events. Everything works fine, but, when I make Visibility.Visible a LinearLayout (android:clickable="true") above the Recyclerview, and later I make it Visibility.Gone .Then the recyclerView does not gets the…
X.Otano
  • 2,079
  • 1
  • 22
  • 40
0
votes
1 answer

Android MapView in ListView Header is not calling onTouchEvent

I have a ListView where I add a Google Map MapView into the header view, below is the code on how I do that: vListViewTrips.addHeaderView(vMapHeaderView, null, false); The map is shown and works but the map does not handle any gestures when its…
0
votes
2 answers

Is it possible to inject an event within my service to other apps without root?

I'm making an android application that will inject touch events based on motions that I make. So far, I can use instrumentations to inject events but only within my application. I want to be able to use this service in other apps as well. I've read…
0
votes
0 answers

How to disable batching for ACTION_MOVE event recieved in onInterceptTouchEvent?

Presently, I receive at most two ACTION_MOVE after ACTION_DOWN, and no matter how much I drag, no subsequent ACTION_MOVE is received in onInterceptTouchEvent of ViewPager. Is there a way to receive ACTION_MOVE more frequently?
q126y
  • 1,589
  • 4
  • 18
  • 50