Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
HandlerThread(String name) |
HandlerThread(String name,
int priority)
Constructs a HandlerThread.
|
Modifier and Type | Method and Description |
---|---|
Looper |
getLooper()
This method returns the Looper associated with this thread.
|
int |
getThreadId()
Returns the identifier of this thread.
|
protected void |
onLooperPrepared()
Call back method that can be explicitly overridden if needed to execute some
setup before Looper loops.
|
boolean |
quit()
Ask the currently running looper to quit.
|
void |
run()
Calls the
run() method of the Runnable object the receiver
holds. |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, parkFor, parkUntil, popInterruptAction$, pushInterruptAction$, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, unpark, yield
public HandlerThread(String name)
protected void onLooperPrepared()
public void run()
Thread
run()
method of the Runnable object the receiver
holds. If no Runnable is set, does nothing.run
in interface Runnable
run
in class Thread
Thread.start()
public Looper getLooper()
public boolean quit()
getLooper()
returns
null), then false is returned. Otherwise the looper is asked to
quit and true is returned.public int getThreadId()