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
90
votes
11 answers

Detecting a long press in 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,625
  • 5
  • 33
  • 56
71
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
  • 972
  • 2
  • 10
  • 20
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?
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
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,387
  • 4
  • 17
  • 15
31
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
  • 1,056
  • 4
  • 17
  • 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
  • 391
  • 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…
Mostafa Fahimi
  • 510
  • 1
  • 8
  • 23
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…
9
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
  • 5,200
  • 3
  • 20
  • 45
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,361
  • 10
  • 46
  • 69
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…
gregtzar
  • 2,458
  • 3
  • 26
  • 31
6
votes
1 answer

Show affordance/hover/tooltip on a long-clicked View

I would like to show a tooltip, i.e. additional non-essential information about a View when the user long-clicks on it. The two options I see in front of me are using an OnLongClickListener to construct a custom tooltip in front of the clicked…
Cheezmeister
  • 4,895
  • 3
  • 31
  • 37
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,691
  • 4
  • 38
  • 64
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,478
  • 1
  • 13
  • 21
1
2 3 4 5 6 7