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.

95 questions
77
votes
11 answers

Detecting a long press with Android

I am currently using onTouchEvent(MotionEvent event){ } to detect when the user presses my glSurfaceView is there a way to detect when a long click is made. I'm guessing if I can't find much in the dev docs then it will be some sort of work around…
Jack
  • 2,485
  • 5
  • 30
  • 53
70
votes
7 answers

creating a menu after a long click event on a list view

I have a list view connected to a database, showing a all the entries. I want a menu to show up if the user long clicks a item in the listview(database entry), showing options to edit or delete the entry. how can i do this. Till now, I have tried…
Eriz
  • 951
  • 2
  • 10
  • 19
39
votes
3 answers

How do you implement context menu in a ListActivity on Android?

How do you implement a context menu triggered by a long click or tap on a ListActivity that is using the built in layouts and a ListAdapter?
pupeno
  • 256,034
  • 114
  • 324
  • 541
34
votes
3 answers

Long click on ListFragment

I'm working with a ListFragment and doing a onListItemClick. Everything works fine, but now I want to use a long Item Click (e.g setOnItemLongClickListener(new OnItemLongClickListener() for an Activity). How can I use this in my fragment? Thanks!
tsync
  • 2,257
  • 4
  • 16
  • 15
26
votes
2 answers

Android - Why does onItemLongClick(...) return a boolean?

Coming from a Java background I am used to dealing with actions though I'm not really sure why the method requires a boolean is returned and don't fully understand the explanation given on the site: true if the callback consumed the long click,…
Tim
  • 978
  • 4
  • 15
  • 34
23
votes
8 answers

android maps: How to Long Click a Map?

How do I long click on a mapview so that a place marker appears at that point on the map? I tried a couple ways without success: 1) Using setOnLongClickListener on the MapvView which never detected the longclicks. 2) My other idea was to extend…
vamsibm
  • 381
  • 2
  • 4
  • 7
11
votes
1 answer

Android - Is It possible to disable the long click of home button to avoid the task manager?

I am looking for a way to disable the task manager window once I long press on the home button. I managed to disable other device keys (such as volume, menu etc) and the normal click on the home button as I am the default launcher, but I don't know…
Amir
  • 153
  • 1
  • 1
  • 9
10
votes
5 answers

Set long click listener for listview

I have below codes: public class MainActivity extends ListActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } protected void…
Matarata
  • 255
  • 1
  • 6
  • 18
9
votes
3 answers

Stop OnLongClickListener from firing while dragging

I have a custom View with bitmaps on it that the user can drag about. I want to make it so when they long click one of them I can pop up a context menu with options such as reset position etc. In the custom View I add my…
8
votes
2 answers

ActionbarSherlock: Long-click on action item show a Toast?

When an action item is long-clicked, a Toast without text is show below the action item. Can I disable the Toast? Thanks you.
Wayne
  • 6,093
  • 10
  • 43
  • 65
7
votes
2 answers

Horizontal menu inflater on long click for web view

I am having a problem with the webview selection on longClick. I already had an implementation of a customized menu that launches on longClick. But the default menu is launching as well. I am trying to customize the default menu, but I'm not knowing…
coder
  • 3,982
  • 2
  • 16
  • 38
7
votes
3 answers

Can angular's ngTouch library be used to detect a long click (touch/hold/release in place) event?

My AngularJS app needs to be able to detect both the start and stop of a touch event (without swiping). For example, I need to execute some logic when the touch begins (user presses down their finger and holds), and then execute different logic when…
gregtczap
  • 2,224
  • 3
  • 25
  • 31
6
votes
1 answer

How to trigger an Android LongClick in Xamarin UI Test

I've got a RecyclerView with a ActionMode which can be activated by a long click on a RecyclerView item. How to trigger a long click in Android with Xamarin UI tests? AndroidApp contains a method TouchAndHold(Func query) but this one seems not to…
Luciano
  • 2,278
  • 4
  • 31
  • 55
6
votes
3 answers

Disable long click in android webview

I am using css columns to display contents in android webview. I used longclicklistner {return true}; with this I was able to disable longclick in phones but it doesn't seem to work in tabs(eg galaxy tab 2). I'm also preventing touchmove event using…
Jithu
  • 1,418
  • 13
  • 21
5
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…
1
2 3 4 5 6 7