android.os.Handler.dispatchMessage()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(894)

本文整理了Java中android.os.Handler.dispatchMessage()方法的一些代码示例,展示了Handler.dispatchMessage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Handler.dispatchMessage()方法的具体详情如下:
包路径:android.os.Handler
类名称:Handler
方法名:dispatchMessage

Handler.dispatchMessage介绍

暂无

代码示例

代码示例来源:origin: google/ExoPlayer

target.dispatchMessage(pendingMessage.message);
} catch (Throwable t) {

代码示例来源:origin: robolectric/robolectric

private static void dispatchMessage(Message msg) {
 final Handler target = msg.getTarget();
 shadowOf(msg).setNext(null);
 // If target is null it means the message has been removed
 // from the queue prior to being dispatched by the scheduler.
 if (target != null) {
  _Message_ msgProxy = reflector(_Message_.class, msg);
  msgProxy.markInUse();
  target.dispatchMessage(msg);
  if (getApiLevel() >= LOLLIPOP) {
   msgProxy.recycleUnchecked();
  } else {
   msgProxy.recycle();
  }
 }
}

代码示例来源:origin: google/ExoPlayer

target.dispatchMessage(pendingMessage.message);
} catch (Throwable t) {

代码示例来源:origin: alighters/CubeGrid

@Override
  public void dispatchMessage(Message msg) {
    super.dispatchMessage(msg);
    if (msg.what == ANIM_MSG) {
      if (mStoped) {
        return;
      }
      startAnimLoop();
    }
  }
};

代码示例来源:origin: the-pig-of-jungle/SmartShow

@Override
public void dispatchMessage(Message msg) {
  try {
    super.dispatchMessage(msg);
  } catch (WindowManager.BadTokenException e) {
  }
}

代码示例来源:origin: the-pig-of-jungle/smart-show

@Override
public void dispatchMessage(Message msg) {
  try {
    super.dispatchMessage(msg);
  } catch (WindowManager.BadTokenException e) {
  }
}

代码示例来源:origin: SilenceDut/TaskScheduler

@Override
  public void dispatchMessage(Message msg) {
    try {
      super.dispatchMessage(msg);
    } catch (Exception e) {
      Log.d(TAG, "dispatchMessage Exception " + msg + " , " + e);
    } catch (Error error) {
      Log.d(TAG, "dispatchMessage error " + msg + " , " + error);
    }
  }
}

代码示例来源:origin: KDE/kdeconnect-android

public void setPlayerStatusUpdatedHandler(String id, Handler h) {
  playerStatusUpdated.put(id, h);
  h.dispatchMessage(new Message());
}

代码示例来源:origin: KDE/kdeconnect-android

public void setPlayerListUpdatedHandler(String id, Handler h) {
  playerListUpdated.put(id, h);
  h.dispatchMessage(new Message());
}

代码示例来源:origin: mrrobot97/NetSpeed

@Override
  public void dispatchMessage(Message msg) {
    super.dispatchMessage(msg);
    calculateNetSpeed();
    sendEmptyMessageDelayed(0,INTERVAL);
  }
};

代码示例来源:origin: microg/android_external_GmsApi

@Override
  public void send(Message message) throws RemoteException {
    message.arg2 = Binder.getCallingUid();
    handler.dispatchMessage(message);
  }
}

代码示例来源:origin: KDE/kdeconnect-android

public void fetchedAlbumArt(String url) {
  boolean doEmitUpdate = false;
  for (MprisPlayer player : players.values()) {
    if (url.equals(player.albumArtUrl)) {
      doEmitUpdate = true;
    }
  }
  if (doEmitUpdate) {
    for (String key : playerStatusUpdated.keySet()) {
      try {
        playerStatusUpdated.get(key).dispatchMessage(new Message());
      } catch (Exception e) {
        e.printStackTrace();
        Log.e("MprisControl", "Exception");
        playerStatusUpdated.remove(key);
      }
    }
  }
}

代码示例来源:origin: why168/LoopViewPagerLayout

@Override
  public void dispatchMessage(Message msg) {
    super.dispatchMessage(msg);
    if (msg.what == MESSAGE_LOOP) {
      if (loopViewPager.getCurrentItem() < Short.MAX_VALUE - 1) {
        loopViewPager.setCurrentItem(loopViewPager.getCurrentItem() + 1, true);
        sendEmptyMessageDelayed(MESSAGE_LOOP, getLoop_ms());
      }
    }
  }
};

代码示例来源:origin: grzegorznittner/chanu

@Override
  public void dispatchMessage(Message message) {
    mRoot.lockRenderThread();
    try {
      super.dispatchMessage(message);
    } finally {
      mRoot.unlockRenderThread();
    }
  }
}

代码示例来源:origin: org.robolectric/shadows-core-v23

private static void dispatchMessage(Message msg) {
  final Handler target = msg.getTarget();
  
  shadowOf(msg).setNext(null);
  // If target is null it means the message has been removed
  // from the queue prior to being dispatched by the scheduler.
  if (target != null) {
   callInstanceMethod(msg, "markInUse");
   target.dispatchMessage(msg);
   callInstanceMethod(msg, "recycleUnchecked");
  }
 }
}

代码示例来源:origin: small-dream/VideoRecord

@Override
  public void dispatchMessage(Message msg) {
    switch (msg.what) {
    case HANDLER_INVALIDATE_ACTIVE:
      invalidate();
      mActiveState = !mActiveState;
      if (!mStop)
        sendEmptyMessageDelayed(0, 300);
      break;
    case HANDLER_INVALIDATE_RECORDING:
      invalidate();
      if (mProgressChanged)
        sendEmptyMessageDelayed(0, 50);
      break;
    }
    super.dispatchMessage(msg);
  }
};

代码示例来源:origin: KDE/kdeconnect-android

playerStatusUpdated.get(key).dispatchMessage(new Message());
  } catch (Exception e) {
    e.printStackTrace();
for (String key : playerListUpdated.keySet()) {
  try {
    playerListUpdated.get(key).dispatchMessage(new Message());
  } catch (Exception e) {
    e.printStackTrace();

代码示例来源:origin: org.robolectric/shadows-framework

private static void dispatchMessage(Message msg) {
 final Handler target = msg.getTarget();
 shadowOf(msg).setNext(null);
 // If target is null it means the message has been removed
 // from the queue prior to being dispatched by the scheduler.
 if (target != null) {
  callInstanceMethod(msg, "markInUse");
  target.dispatchMessage(msg);
  if (getApiLevel() >= LOLLIPOP) {
   callInstanceMethod(msg, "recycleUnchecked");
  } else {
   callInstanceMethod(msg, "recycle");
  }
 }
}

代码示例来源:origin: org.robolectric/shadows-core

private static void dispatchMessage(Message msg) {
  final Handler target = msg.getTarget();

  shadowOf(msg).setNext(null);
  // If target is null it means the message has been removed
  // from the queue prior to being dispatched by the scheduler.
  if (target != null) {
   callInstanceMethod(msg, "markInUse");
   target.dispatchMessage(msg);

   if (getApiLevel() >= LOLLIPOP) {
    callInstanceMethod(msg, "recycleUnchecked");
   } else {
    callInstanceMethod(msg, "recycle");
   }
  }
 }
}

代码示例来源:origin: org.robolectric/framework

private static void dispatchMessage(Message msg) {
  final Handler target = msg.getTarget();

  shadowOf(msg).setNext(null);
  // If target is null it means the message has been removed
  // from the queue prior to being dispatched by the scheduler.
  if (target != null) {
   callInstanceMethod(msg, "markInUse");
   target.dispatchMessage(msg);

   if (getApiLevel() >= LOLLIPOP) {
    callInstanceMethod(msg, "recycleUnchecked");
   } else {
    callInstanceMethod(msg, "recycle");
   }
  }
 }
}

相关文章