Best code examples for Android Looper class (android.os.Looper)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Looper class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android Looper examples from Open Source projects
Examples using Android Looper getThread method:
This code example shows how to use the following methods: getThread, quit
105:	mLooper.quit(); 
-
111:	mLooper.getThread().join(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getThread, quit
105:	mLooper.quit(); 
-
111:	mLooper.getThread().join(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getThread, quit
216:	mLooper.quit(); 
-
222:	mLooper.getThread().join(); 
Full Snippet Info
5
CodeRank
Examples using Android Looper quit method:
This code example shows how to use the following methods: quit
625:	mLooper.quit(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: quit, sleep
102:	mLooper.quit(); 
-
105:	Thread.sleep(1000); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: quit
693:	mLooper.quit(); 
Full Snippet Info
6
CodeRank
Examples for other Android Looper methods:
Related Android Looper Questions & Answers:
Looper Class Overview
Class used to run a message loop for a thread. Threads by default do not have a message loop associated with them; to create one, call prepare() in the thread that is to run the loop, and then loop() to have it process messages until the loop is stopped. Most interaction with a message loop is through the Handler class. This is a typical example of the implementation of a Looper thread, using the separation of prepare() and loop() to create an initial Handler to communicate with the Looper.

class LooperThread extends Thread { public Handler mHandler; public void run() { Looper.prepare(); mHandler = new Handler() { public void handleMessage(Message msg) { // process incoming messages here...
Methods
  • getThread
    Return the Thread associated with this Looper.
  • loop
    Run the message queue in this thread.
  • myQueue
    Return the MessageQueue object associated with the current thread.
  • prepare
    Initialize the current thread as a looper.
  • quit
    Quits the looper.