Questions tagged [long-click]

In touch based user interfaces a long-click (aka long-press and tap-and-hold) refers to pressing a control for a prolonged time in order to achieve additional functionality.

In touch based user interfaces a long-click (aka long-press and tap-and-hold) refers to pressing a control for a prolonged time in order to achieve additional functionality.

97 questions
6
votes
1 answer

Receive a long press/click on a linear layout in android?

I'm painfully new to android and I've run into a wall. I'm trying get a linear layout to function more like a button, with different actions for press and long press - The reason being so I can have 2 differently formatted text labels on each…
5
votes
1 answer

How to disable text selection in a webview in Android?

My application playing HTML promotions in WebView, Html promotions having text so if user press long click android standard dialog appear Copy/Share/Find/Web Search, so is there any option to disable text selection dialog for webview ? Help me on…
Dale
  • 131
  • 2
  • 5
4
votes
6 answers

Android ActionBar options long click event

Android Can anyone know about Actionbar item options long click , I want to show text on LongClick on actionbar menu option like a hint on long press of actionBar long press
user1206890
  • 41
  • 1
  • 1
  • 4
4
votes
2 answers

Android : How to listen to longclick events in any text area in other applications?

I'm trying to develop an Android application that provides an extra option when pasting data anywhere. I know how to capture data from the clipboard. I just need to know how to listen to longclick events in any text area in other applications such…
Doaa A.
  • 129
  • 1
  • 2
  • 11
3
votes
5 answers

how to handle long click in Android

I am new to Android dev. The way I have been handling clicks has been by setting the android:onClick attribute in the manifest file for buttons. What I am wondering is the best way to handle long clicks in general. I have read about implementing…
ewok
  • 20,148
  • 51
  • 149
  • 254
3
votes
2 answers

Android TabLayout annoying popup (tooltip) on tab title long click

I imagine someone has had this question before, I just don't quite know what the right keywords are to find the answer? I am making an android app with an activity that includes tabs using TabLayout. Nothing fancy, just really standard stuff. In…
3
votes
3 answers

Long click to begin selecting items in a ListView?

My question is simple: How do I use long click to let the users select items from the ListView ? So far, I only know how to detect 'short' clicks and take appropriate actions. Also, I would like to display a check mark on the selected item. How…
An SO User
  • 24,612
  • 35
  • 133
  • 221
3
votes
3 answers

How to Change background color of list item in Android?

How to change the background color onlongclick of list item in android, now iam getting the position of the list item onlongclick by using below code. listView.setOnItemLongClickListener(new OnItemLongClickListener() { public boolean…
user2199280
  • 347
  • 1
  • 3
  • 12
3
votes
1 answer

what is relation between android WebView and WebViewClassic

I am having a problem in copy-paste on long click on text inside my class extending Android WebView. I'm able to copy, but paste is not working. While investigating, somewhere on net got suggestion to look into android.webkit.WebViewClassic. In…
Shirish Herwade
  • 11,461
  • 20
  • 72
  • 111
3
votes
0 answers

Android - Drag on LongClick with GridView - Unable to initiate drag

I'm developping a thumbnail mosaic of all pictures on SdCard. If the user longclick on a picture, i want to start drag and drop process. I clearly manage to get all images files and showing them with my own BaseAdapter in a GridView, but the process…
Seballot
  • 261
  • 2
  • 8
2
votes
1 answer

Jetpack Compose pointerInput detectTapGestures Set onLongPress timeout?

To implement a Long Press feature on a button or a composable in general the way is to use the Tap Gestures detected in the modifier pointerinput the code seems pretty straightforward and it works. Box(modifier = modifier.pointerInput(Unit) { …
2
votes
5 answers

How to get onTouchEvent, long click and context menu working together?

In our application we have a custom view (that extends ImageView) and in it we handle the touch events to record data. I wanted to add context menu functionality to this view and followed the guidelines in the official Android documents. The…
alokoko
  • 1,405
  • 4
  • 21
  • 35
2
votes
0 answers

Element drag working only once on webview

I have a page that got elements that when long clicked makes it draggable. It works on the Chrome app but not on my WebView. This is my WebSettings. String UA = "Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19" + …
rminaj
  • 560
  • 6
  • 28
2
votes
0 answers

Android. GestureDetector longPress - longer threshold or timeout

I need to capture a long press, plus the coordinates of the event. It seems to me that a longer threshold or timeout for the long press action will fit better. final GestureDetector gestureDetector = new GestureDetector(new…
pulancheck1988
  • 2,024
  • 3
  • 28
  • 46
2
votes
2 answers

Android OnLongClickListener strange / unreliable behaviour

I'm currently fighting against the OnLongClickListener on Android Api Lvl 8. Take this code: this.webView.setOnLongClickListener(new OnLongClickListener() { @Override public boolean onLongClick(View v) { System.out.println("long…
Arman
  • 875
  • 2
  • 8
  • 30