Methods Summary |
---|
public android.os.Handler | getHandler()
return mHandler;
|
public boolean | hasAnyMessages(int[] what)
synchronized (mHandler.getLooper().getQueue()) {
for (int i : what) {
if (mHandler.hasMessages(i)) {
return true;
}
}
}
return false;
|
protected void | onLooperPrepared()
mHandler = new Handler(getLooper(), mCallback);
mStarted.open();
|
public void | removeMessages(int[] what)
synchronized (mHandler.getLooper().getQueue()) {
for (int i : what) {
mHandler.removeMessages(i);
}
}
|
public android.os.Handler | waitAndGetHandler()
waitUntilStarted();
return getHandler();
|
public void | waitUntilIdle()
// Blocks until thread is idling
Handler handler = waitAndGetHandler();
Looper looper = handler.getLooper();
if (looper.isIdling()) {
return;
}
mIdle.close();
looper.getQueue().addIdleHandler(mIdleHandler);
// Ensure that the idle handler gets run even if the looper already went idle
handler.sendEmptyMessage(MSG_POKE_IDLE_HANDLER);
if (looper.isIdling()) {
return;
}
mIdle.block();
|
public void | waitUntilStarted()
mStarted.block();
|