In the Observer pattern, an event handler is the function or method called on an observer listening for an event dispatched by the subject. Also known as an event listener.
Questions tagged [handler]
3718 questions
906
votes
35 answers
How to call a method after a delay in Android
I want to be able to call the following method after a specified delay.
In objective c there was something like:
[self performSelector:@selector(DoSomething) withObject:nil afterDelay:5];
Is there an equivalent of this method in android with…

aryaxt
- 76,198
- 92
- 293
- 442
265
votes
12 answers
Is AsyncTask really conceptually flawed or am I just missing something?
I have investigated this problem for months now, came up with different solutions to it, which I am not happy with since they are all massive hacks. I still cannot believe that a class that flawed in design made it into the framework and no-one is…

mxk
- 43,056
- 28
- 105
- 132
251
votes
10 answers
Calling a function when ng-repeat has finished
What I am trying to implement is basically a "on ng repeat finished rendering" handler. I am able to detect when it is done but I can't figure out how to trigger a function from it.
Check the fiddle:http://jsfiddle.net/paulocoelho/BsMqq/3/
JS
var…

PCoelho
- 7,850
- 11
- 31
- 36
222
votes
7 answers
jQuery .live() vs .on() method for adding a click event after loading dynamic html
I am using jQuery v.1.7.1 where the .live() method is apparently deprecated.
The problem I am having is that when dynamically loading html into an element using:
$('#parent').load("http://...");
If I try and add a click event afterwards it does…

Sean Thoman
- 7,429
- 6
- 56
- 103
209
votes
6 answers
Create a custom event in Java
I want to do something like this in Java but I don't know the way:
When event "object 1 say 'hello'" happens,
then object 2 responds to that event by saying "hello".
Can somebody give me a hint or sample code?

conmadoi
- 2,163
- 3
- 14
- 5
148
votes
12 answers
AsyncTask and error handling on Android
I'm converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What's unclear to me is how to handle exceptions if something goes haywire in…

Bostone
- 36,858
- 39
- 167
- 227
142
votes
6 answers
Stop handler.postDelayed()
I call multiple Handlers by new Handler().postDelayed(new Runnable().....
How can I stop it when I click on back?
public class MyActivity extends AppCompatActivity implements OnClickListener {
private Button btn;
private Handler handler;
…

basti12354
- 2,490
- 4
- 24
- 43
128
votes
9 answers
Completion handler for UINavigationController "pushViewController:animated"?
I'm about creating an app using a UINavigationController to present the next view controllers.
With iOS5 there´s a new method to presenting UIViewControllers:
presentViewController:animated:completion:
Now I ask me why isn´t there a completion…

geforce
- 2,593
- 3
- 28
- 44
126
votes
9 answers
Javascript event handler with parameters
I want to make an eventHandler that passes the event and some parameters. The problem is that the function doesn't get the element. Here is an example:
doClick = function(func){
var elem = .. // the element where it is all about
elem.onclick…

sebas2day
- 2,013
- 2
- 15
- 14
113
votes
3 answers
Timertask or Handler
Let's say that I want to perform some action every 10 seconds and it doesn't necessarily need to update the view.
The question is: is it better (I mean more efficient and effective) to use timer with timertask like here:
final Handler handler = new…

keysersoze
- 2,562
- 4
- 21
- 22
110
votes
5 answers
What is the relationship between Looper, Handler and MessageQueue in Android?
I have checked the official Android documentation/guide for Looper, Handler and MessageQueue . But I couldn't get it. I am new to android, and got very confused with these concepts.

Blake
- 7,367
- 19
- 54
- 80
104
votes
3 answers
What is a handler?
I am trying to learn some programming related terms, and I often come over the word "handler". Can anyone please explain what it means and when to use it?
tji
96
votes
7 answers
Accessing UI thread handler from a service
I am trying some thing new on Android for which I need to access the handler of the UI thread.
I know the following:
The UI thread has its own handler
and looper
Any message will be put
into the message queue of the UI
thread
The looper picks up…

iLikeAndroid
- 1,106
- 1
- 8
- 6
93
votes
3 answers
How do I write an Ansible handler with multiple tasks?
In response to a change, I have multiple related tasks that should run.
How do I write an Ansible handler with multiple tasks?
For example, I would like a handler that restarts a service only if already started:
- name: Restart conditionally
…

Tim Diels
- 3,246
- 2
- 19
- 22
87
votes
12 answers
What's the difference between Event Listeners & Handlers in Java?
In general terms of java, there are listeners & handlers for events.
I mean I use them unknowingly, just whichever is available in the API.
My question is, in what case do we use listeners and in what case do we use handlers for events?
What's the…

jlc488
- 1,051
- 1
- 8
- 10