本文整理了Java中android.os.Handler.removeCallbacksAndMessages()
方法的一些代码示例,展示了Handler.removeCallbacksAndMessages()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Handler.removeCallbacksAndMessages()
方法的具体详情如下:
包路径:android.os.Handler
类名称:Handler
方法名:removeCallbacksAndMessages
暂无
代码示例来源:origin: ReactiveX/RxAndroid
@Override
public void dispose() {
disposed = true;
handler.removeCallbacksAndMessages(this /* token */);
}
代码示例来源:origin: google/ExoPlayer
/** Releases the component listener. */
public void release() {
released = true;
playerHandler.removeCallbacksAndMessages(null);
}
代码示例来源:origin: google/ExoPlayer
/** Release this emsg handler. It should not be reused after this call. */
public void release() {
released = true;
handler.removeCallbacksAndMessages(null);
}
代码示例来源:origin: google/ExoPlayer
@Override
public void removeCallbacksAndMessages(Object token) {
handler.removeCallbacksAndMessages(token);
}
代码示例来源:origin: google/ExoPlayer
@Override
public void removeCallbacksAndMessages(Object token) {
handler.removeCallbacksAndMessages(token);
}
代码示例来源:origin: androidannotations/androidannotations
/**
* Cancel all tasks having the specified <code>id</code>.
*
* @param id
* the cancellation identifier
*/
public static void cancelAll(String id) {
Token token;
synchronized (TOKENS) {
token = TOKENS.remove(id);
}
if (token == null) {
// nothing to cancel
return;
}
HANDLER.removeCallbacksAndMessages(token);
}
代码示例来源:origin: Bigkoo/Android-PickerView
@Override
protected void onDestroy() {
super.onDestroy();
if (mHandler != null) {
mHandler.removeCallbacksAndMessages(null);
}
}
}
代码示例来源:origin: chrisbanes/PhotoView
@Override
protected void onPause() {
super.onPause();
handler.removeCallbacksAndMessages(null);
}
代码示例来源:origin: chrisbanes/PhotoView
private void toggleRotation() {
if (rotating) {
handler.removeCallbacksAndMessages(null);
} else {
rotateLoop();
}
rotating = !rotating;
}
代码示例来源:origin: google/ExoPlayer
@Override
public void removeCallbacksAndMessages(Object token) {
handler.removeCallbacksAndMessages(token);
}
代码示例来源:origin: google/ExoPlayer
@Override
public void releaseSourceInternal() {
manifest = sideloadedManifest ? manifest : null;
manifestDataSource = null;
manifestLoadStartTimestamp = 0;
if (manifestLoader != null) {
manifestLoader.release();
manifestLoader = null;
}
if (manifestRefreshHandler != null) {
manifestRefreshHandler.removeCallbacksAndMessages(null);
manifestRefreshHandler = null;
}
}
代码示例来源:origin: lingochamp/FileDownloader
void discardAllMessage() {
if (handler != null) {
handler.removeCallbacksAndMessages(null);
handlerThread.quit();
parkThread = Thread.currentThread();
while (handlingMessage) {
LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(100));
}
parkThread = null;
}
}
代码示例来源:origin: robolectric/robolectric
@Implementation
protected void removeFrameCallback(FrameCallback callback) {
handler.removeCallbacksAndMessages(callback);
}
代码示例来源:origin: google/ExoPlayer
@Override
public void releaseSourceInternal() {
assertThat(preparedSource).isTrue();
assertThat(releasedSource).isFalse();
assertThat(activeMediaPeriods.isEmpty()).isTrue();
releasedSource = true;
preparedSource = false;
sourceInfoRefreshHandler.removeCallbacksAndMessages(null);
sourceInfoRefreshHandler = null;
}
代码示例来源:origin: google/ExoPlayer
public void release() {
if (prepared) {
// Discard as much as we can synchronously. We only do this if we're prepared, since otherwise
// sampleQueues may still be being modified by the loading thread.
for (SampleQueue sampleQueue : sampleQueues) {
sampleQueue.discardToEnd();
}
}
loader.release(this);
handler.removeCallbacksAndMessages(null);
released = true;
hlsSampleStreams.clear();
}
代码示例来源:origin: lingochamp/FileDownloader
public void freeze() {
mList.get(mRunningIndex).getOrigin().removeFinishListener(mSerialFinishListener);
mHandler.removeCallbacksAndMessages(null);
}
代码示例来源:origin: google/ExoPlayer
@Override
public void release() {
Log.i(TAG, "Release " + Integer.toHexString(System.identityHashCode(this)) + " ["
+ ExoPlayerLibraryInfo.VERSION_SLASHY + "] [" + Util.DEVICE_DEBUG_INFO + "] ["
+ ExoPlayerLibraryInfo.registeredModules() + "]");
mediaSource = null;
internalPlayer.release();
eventHandler.removeCallbacksAndMessages(null);
}
代码示例来源:origin: robolectric/robolectric
private static void resetStateApi26() {
Handler queuedWorkHandler = ReflectionHelpers.getStaticField(QueuedWork.class, "sHandler");
if (queuedWorkHandler != null) {
queuedWorkHandler.removeCallbacksAndMessages(null);
}
_QueuedWork_ _queuedWorkStatic_ = reflector(_QueuedWork_.class);
_queuedWorkStatic_.getFinishers().clear();
_queuedWorkStatic_.getWork().clear();
_queuedWorkStatic_.setNumWaits(0);
}
代码示例来源:origin: google/ExoPlayer
public void release() {
if (prepared) {
// Discard as much as we can synchronously. We only do this if we're prepared, since otherwise
// sampleQueues may still be being modified by the loading thread.
for (SampleQueue sampleQueue : sampleQueues) {
sampleQueue.discardToEnd();
}
}
loader.release(/* callback= */ this);
handler.removeCallbacksAndMessages(null);
callback = null;
released = true;
eventDispatcher.mediaPeriodReleased();
}
代码示例来源:origin: google/ExoPlayer
@Override
public void releaseSourceInternal() {
assertThat(preparedSource).isTrue();
assertThat(releasedSource).isFalse();
assertThat(activeMediaPeriods.isEmpty()).isTrue();
releasedSource = true;
preparedSource = false;
sourceInfoRefreshHandler.removeCallbacksAndMessages(null);
sourceInfoRefreshHandler = null;
}
内容来源于网络,如有侵权,请联系作者删除!