`
mickey_hou
  • 浏览: 238348 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

Android handler设置延时加载

阅读更多
/*
         * 设置首页加载   延时3秒
         */
        new Handler().postDelayed(new Runnable()
        {
           
            public void run()
            {
                /*
                 * 判断当前网络是否可用
                 */
                if (NetworkDetector.detect(indexContext))
                {
                    Intent intent = new Intent(indexContext,VoiceIdentifyActivity.class);
                    intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
                    finish();
                    startActivity(intent);
                   
                    /*
                     * 添加界面切换效果
                     */
                    overridePendingTransition(R.anim.zoomin, R.anim.zoomout);   
                }
                else
                {
                    deal.showToast(indexContext, Parameters.NETWORK_DETECT_FAIL);
                }
               
            }
        },  HANDLER_DETLAYMILLIS);
    }
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics