当前位置: 首页>>代码示例>>Java>>正文


Java Handler.removeCallbacksAndMessages方法代码示例

本文整理汇总了Java中android.os.Handler.removeCallbacksAndMessages方法的典型用法代码示例。如果您正苦于以下问题:Java Handler.removeCallbacksAndMessages方法的具体用法?Java Handler.removeCallbacksAndMessages怎么用?Java Handler.removeCallbacksAndMessages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.os.Handler的用法示例。


在下文中一共展示了Handler.removeCallbacksAndMessages方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: TextViewLinkHandler

import android.os.Handler; //导入方法依赖的package包/类
public TextViewLinkHandler(ClickableText clickableText, String subreddit, Spannable sequence) {
    this.clickableText = clickableText;
    this.subreddit = subreddit;
    this.sequence = sequence;

    clickHandled = false;
    handler = new Handler();
    longClicked = new Runnable() {
        @Override
        public void run() {
            // long click
            clickHandled = true;

            handler.removeCallbacksAndMessages(null);
            if (link != null && link.length > 0 && link[0] != null) {
                TextViewLinkHandler.this.clickableText.onLinkLongClick(link[0].getURL(), event);
            }

        }
    };
}
 
开发者ID:ccrama,项目名称:Slide-RSS,代码行数:22,代码来源:TextViewLinkHandler.java

示例2: stopAnimAndRemoveCallbacks

import android.os.Handler; //导入方法依赖的package包/类
private void stopAnimAndRemoveCallbacks(){
    isStart=false;
    for (Map.Entry<String, ValueAnimator> entry : animMap.entrySet()) {
        entry.getValue().end();
    }
    Handler handler=this.getHandler();
    if (handler!=null){
        handler.removeCallbacksAndMessages(null);
    }
}
 
开发者ID:Zweihui,项目名称:Aurora,代码行数:11,代码来源:WeatherView.java

示例3: suicaMaker

import android.os.Handler; //导入方法依赖的package包/类
protected void suicaMaker(int time) {
    mScore = 0;
    mRunning = true;
    mLimitTime = time;
    final int diffTime = 2000;

    suicaRunnable = new Runnable() {
        @Override
        public void run() {
            addSuica();
            if (TIME_LIMIT - mTimerCnt < 0) {
                mRunning = false;

                showRankingDialog();
                backGround.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        showRankingDialog();
                    }
                });

            }
            if(mRunning) {
                int offsetParam = mDoitsu ? 100 : 600;
                long offset = Math.max(-mDiffLimit, - mScore / offsetParam);
                suicaHandler.postDelayed(suicaRunnable, diffTime + offset);
            } else {
                suicaHandler.removeCallbacksAndMessages(null);
            }
        }
    };
    suicaHandler = new Handler();
    suicaHandler.postDelayed(suicaRunnable, diffTime);


    mTimerText.setText("00:00.0");
    mTimerCnt = 0;

    mClockRunnable = new Runnable() {
        @Override
        public void run() {
            suicaHandler.post(new Runnable() {
                public void run() {
                    mTimerCnt+=1000;
                    int t = TIME_LIMIT - mTimerCnt;
                    if(t >= 0) {
                        t /= 1000;
                    } else {
                        t = 0;
                    }
                    long mm = t / 60;
                    long ss = t % 60;
                    mTimerText.setText(String.format("%1$02d:%2$02d", mm, ss));
                }
            });
            suicaHandler.postDelayed(mClockRunnable, 1000);
        }
    };
    suicaHandler.postDelayed(mClockRunnable, 0);
}
 
开发者ID:ShitamatsugeFactory,项目名称:KokoWalk,代码行数:61,代码来源:NaginataActivity.java


注:本文中的android.os.Handler.removeCallbacksAndMessages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。