This page (revision-58) was last changed on 23-Apr-2022 17:06 by HarryMetske

This page was created on 23-Apr-2022 17:05 by Harry Metske

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
58 23-Apr-2022 17:06 29 KB HarryMetske to previous
57 23-Apr-2022 17:05 29 KB HarryMetske to previous | to last
56 23-Apr-2022 17:05 28 KB HarryMetske to previous | to last
55 23-Apr-2022 17:05 26 KB Harry Metske to previous | to last
54 23-Apr-2022 17:05 26 KB Harry Metske to previous | to last
53 23-Apr-2022 17:05 24 KB Harry Metske to previous | to last
52 23-Apr-2022 17:05 24 KB 10.0.0.138 to previous | to last
51 23-Apr-2022 17:05 23 KB 10.0.0.138 to previous | to last
50 23-Apr-2022 17:05 23 KB 10.0.0.138 to previous | to last
49 23-Apr-2022 17:05 22 KB 10.0.0.138 to previous | to last
48 23-Apr-2022 17:05 22 KB 10.0.0.138 to previous | to last
47 23-Apr-2022 17:05 22 KB 10.0.0.138 to previous | to last
46 23-Apr-2022 17:05 20 KB 10.0.0.138 to previous | to last
45 23-Apr-2022 17:05 20 KB 10.0.0.138 to previous | to last
44 23-Apr-2022 17:05 20 KB HarryMetske to previous | to last
43 23-Apr-2022 17:05 19 KB HarryMetske to previous | to last
42 23-Apr-2022 17:05 19 KB Harry Metske to previous | to last
41 23-Apr-2022 17:05 19 KB Harry Metske to previous | to last

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 395 changed one line
Is associated with a specific Thread. One Thread can hand off work to another Thread by sending messages and posting runnables to a Handler associated with another Thread.
Is associated with a specific Thread. One Thread can hand off work to another Thread by sending Messages and posting Runnables to a Handler associated with another ThreadM
At line 397 added 2 lines
A Handler can handle both. A Runnable is an executable piece of code, so the sender of the Runnable knows what to run and delegates this to the handler to run on his thread.
A Message can also be sent, but in that case the code to be executed is in the Handler class, it should determine from the Message what/how to run stuff. (the implementation is in the Handler)
At line 400 added 20 lines
Each Android Thread is associated with a MessageQueue that holds Runnables and Messages. With this MessageQueue there is a __looper__ associated, which picks off the runnables and messages of the queue.
So :
* create Runnable object
* use handler.post(Runnable) to submit it to the handler
* the Runnable is placed on the MessageQueue
* same with Message...
* use handler.sendMessage(Message) to pass it on the the MessageQueue
* meanwhile the looper sits and waits on things in the MessageQueue
* if a Message arrives, the looper calls the handler.handleMessage()
* if a Runnable arrives, the looper will call the Runnable's run() method
Alternatives handler method's :
* postAtTime(Runnable, long)
* postDelayed(Runnable, long)
* create Message with either handler.obtainMessage() or Message.obtain()
* sendMessageAtFrontOfQueue()
* sendMessageAtTime()
* sendMessageDelayed()