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
4
votes
1 answer

Using OnTouchListener and OnLongClickListener interferes with eachother

I have got this button which uses onclicklistener and onlongclicklistener, but also a button which uses ontouchlistener... the point is button 1 is 0,1 second pressed, button 2 is 2 seconds pressed, button 3 could be pressed for 50 seconds or even…
Marco
  • 350
  • 1
  • 4
  • 16
3
votes
5 answers

Android: How to convert 'view' to 'textview'?

I have a number of TextViews that each share a single OnLongClickListener Within the onLongClick event, I want to identify which TextView triggered the event. However, the event is defined as: public boolean onLongClick(View view) I tried casting…
Dave
  • 1,554
  • 4
  • 21
  • 44
3
votes
1 answer

Android fires both onclick and onlongclick on a short click

People thank you all for your thoughts. I feel quite ashamed right now, the problem was nog with the listeners, they send a message to a handler that uses a switch. One simple break statement was missing there causing the program to behave the way…
Saren Inden
  • 3,100
  • 3
  • 28
  • 43
3
votes
3 answers

How can I capture a long press on a Menu Item?

I have a typical menu and I'm wanting to set a onLongClickListener for one of the items. In other words, I want this item to perform it's normal onOptionsItemSelected function, as well as, a long press function. MenuItem item; item =…
adneal
  • 29,668
  • 10
  • 113
  • 145
3
votes
4 answers

Android listen for backbutton longclick

I am overriding the backbutton with a onBackPressed() function how do I also detect long clicks on the backbutton? Is there an equivalent of @Override onBackLongPressed() ?
CQM
  • 36,672
  • 69
  • 214
  • 357
3
votes
1 answer

Trigger onTouch in a Dialog from onLongClick in a fragment

I have an application with an image's feed (Instagram style). I'm trying to show a quick image preview using long click over the image. The main idea is show the image in a dialog when the user made a longclik, then modify zoom when the user move…
Mark Comix
  • 1,776
  • 7
  • 27
  • 44
3
votes
2 answers

Android touch listeners?

I need to nest s few touch listeners. For example I have a ViewGroup that will have the following listeners: onItemClick, onLongItemClick and onTouch.EV == move. The items inside the view group will have an onClick as well. In my tests both sets of…
ahodder
  • 11,060
  • 14
  • 63
  • 109
3
votes
1 answer

onLongClick for plain text inside of a WebView

I am building an app that contains a WebView which will be used to show the user some links and some plain text. I want to make it so that the user can LongClick on a link, or a body of text and get the option to delete that thing from the html…
FoamyGuy
  • 45,328
  • 16
  • 118
  • 151
3
votes
2 answers

OnLongClick with Text View & Edit Text

In Android can the OnLongClickListener be used with EditTexts and TextViews or just Buttons?
Entropy1024
  • 7,269
  • 9
  • 28
  • 30
3
votes
1 answer

how to check the drag and drop is empty or not in android

I'm new to android.now i am creating drag and drop function using three button. I did up to check dragging button should not empty,because i have to get data from that button and dropping button should be empty. how to move the button to only near…
3
votes
4 answers
3
votes
2 answers

How to drag a floating action button over a view pager

Here, I have a view pager that is shared by multiple Fragments which all are contained in a TABLayout as shown…
3
votes
0 answers

How to get dragshadow visible

So I'm using longclicklistener and on longclick I want to start dragging. This works really good but there is some special case when I want to add first another view on layout and then start dragging with added view. When I'm doing that everything…
niksi
  • 61
  • 8
3
votes
0 answers

Android ListView Fast Scroll - onItemLongClick event is triggered when using slider

I have encountered a really weird behavior of Fast Scroll function of ListView component (listView.setFastScrollEnabled(true); ) on Android 4.4, 5.0, 5.1 (4.2.2 and older versions work ok). If the OnItemLongClickListener is set on ListView the…
Quark
  • 1,349
  • 2
  • 18
  • 30
3
votes
1 answer

ListView onClickListeners

I am trying to make long and normal onItemClickListener for my ListView. This code works but when I call the Long-click and removing my finger after the longClickListener was triggered onItemClickListener triggers too. What I'm doing…
AskQuestion
  • 346
  • 3
  • 17
1 2
3
21 22