Questions tagged [onlongclicklistener]

A Listener object that reacts to the click of a Mouse input device, where the button is depressed for an extended period of time before being released.

A OnLongClickListener is a listener object that reacts to the click of a Mouse input device, where the button is depressed for an extended period of time before being released. This type of listener is become much more prevalent since the introduction of smart phones, where a LongClickEvent is triggered from the user holding their finger on the screen for a few seconds.

329 questions
7
votes
4 answers

ListView doesnt fire setOnLongClickListener, only setOnItemClickListener

I'd like to have both type of clicks on a listView - onClick and LongClick. I've implemented it like this: this.listViewSub = (ListView) this.findViewById(R.id.listsub); this.listViewSub.setOnItemClickListener(new OnItemClickListener() { …
Ofershap
  • 577
  • 2
  • 6
  • 20
7
votes
3 answers

Long Click on Clickable span not firing until click is released

I need a clickable span to have both a normal click and a long click methods in my app and i found out here (In Android - How can I register only long clicks using a ClickableSpan) that i could extend the LinkMovementMethod class and the…
wBoekel
  • 113
  • 1
  • 8
7
votes
5 answers

onTouch, onLongClick together in android

I'am adding imageviews to parent layout dynamically. And i'am performing zoom in/out operations onTouch of added image. I want to remove the added view onLongPress of it.…
SANDHYA
  • 731
  • 7
  • 18
  • 26
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
6
votes
1 answer

How do I properly initiate a multi-select Contextual Action Bar for ListFragment (having issues)

I have a ListFragment associated with a simple ArrayAdapter. The ListView holds a list of checkable items and its XML layout is as follows:
5
votes
1 answer

Add onlongclick listener to an alertdialog

I have an AlertDialog in android that contains a list of buddies from sqlite. When I click on the buddy name in the list, that buddy is called. What I want to do is add a longclicklistener to the list as well so I can be prompted to delete the…
wallace.d
  • 51
  • 1
  • 2
5
votes
2 answers

onLongClickListener does not work on WebView

I have the following struktur to implement an longclicklistener. It works if I click on a text on the webview which contains a html-link, so I know the structure is not completely wrong. I removed this link now and the listener just doesn't listen…
nob
  • 1,037
  • 1
  • 10
  • 18
5
votes
2 answers

OnLongClickListener not working

I have an ImageView. I need to use onLongClickListener for ImageView. When I use this code nothing happen. Code: gallery=(Gallery)findViewById(R.id.gall1); gallery.setAdapter(new ImageAdapter(MainActivity.this)); …
user2474320
  • 295
  • 1
  • 4
  • 16
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…
4
votes
2 answers

BaseAdapter and ContextMenu

Hello stackoverflow community, Basically, i have gallery displaying some images using a gridView + imageView
4
votes
3 answers

Disable Long Click for Headers (or Footers) in a ListView

My question is similar to this one: ListView: disabling clicking/focus However, I don't want to disable the default onClick, just the long click. I've registered my ListView for context menu creation, and I want to disable it for a header element…
SapphireSun
  • 8,236
  • 10
  • 44
  • 56
4
votes
2 answers

OnClickListener getting called twice in Android

I have the following use case: when clicking on a View, it should open an Activity and when long clicked, it should open a different Activity after a time which is minimum of, 300ms or user's ACTION_UP event. I have written the following code for…
Amit Tiwari
  • 3,478
  • 6
  • 26
  • 69
4
votes
1 answer

Add OnLongClickListener on android support TabLayout | TabLayout.Tab

I am using the TabLayout found in the Service library. I have tried to add an OnLongClickListener when long-clicking on a tab. It has been impossible for me. I have even been trying to "hack" it by using childViews: View tabLayoutChild =…
Yokich
  • 1,497
  • 1
  • 15
  • 29
4
votes
1 answer

Duration of longClick listener

I want to reduce the time after which my list view respond to long Click Listener. Is it possible to reduce to long Click duration? getListView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override …
megha
  • 281
  • 3
  • 16
4
votes
4 answers

OnLongPress increase time

I have imageView. Im using pan,pinch for imageView. Sometimes i need to delete imageView. So, i used OnLongClickListener for remove image. When i use long click my imageView removing. But when i use OnTouchListener for pan,pinch for imageView…
1
2
3
21 22