Java Code Examples for android.os.Handler.removeMessages()

The following are Jave code examples for showing how to use removeMessages() of the android.os.Handler class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: RabbitCloud   File: LiveRoomActivity.java   View Source Code Vote up 6 votes
@Override
protected void initData() {
    mUri = getIntent().getData();
    if (mUri != null) {
        roomId = mUri.getLastPathSegment();
    } else {
        roomId = getIntent().getStringExtra("roomId");
    }

    mTitles = new String[]{"聊天", "主播"};
    mViewList = new ArrayList<>();
    mPagerAdapter = new LiveRoomViewPagerAdapter(mTitles);
    initPagerView();
    mViewPager.setAdapter(mPagerAdapter);
    mTabLayout.setupWithViewPager(mViewPager);

    //初始化handler 刚进来mControlLayout是显示的,发送个延时消息 5秒后自动隐藏
    mControlHandler = new Handler(this);
    mControlHandler.removeMessages(HANDLER_HIDE_CONTROL);
    mControlHandler.sendEmptyMessageDelayed(HANDLER_HIDE_CONTROL, HANDLER_HIDE_TIME);

    mRoomPresenter.attachView(this);
    mRoomPresenter.getRoomInfo(roomId);
    mRoomPresenter.getChatListInfo(roomId);

}
 
Example 2
Project: aos-MediaLib   File: MusicStoreImportService.java   View Source Code Vote up 4 votes
/** removes all messages from handler */
protected static void removeAllMessages(Handler handler) {
    handler.removeMessages(MESSAGE_KILL);
    handler.removeMessages(MESSAGE_IMPORT_FULL);
    handler.removeMessages(MESSAGE_IMPORT_INCR);
}
 
Example 3
Project: aos-MediaLib   File: VideoStoreImportService.java   View Source Code Vote up 4 votes
/** removes all messages from handler */
protected static void removeAllMessages(Handler handler) {
    handler.removeMessages(MESSAGE_KILL);
    handler.removeMessages(MESSAGE_IMPORT_FULL);
    handler.removeMessages(MESSAGE_IMPORT_INCR);
}