方向改变检测时间

时间:2014-03-15 14:37:08

标签: android handler screen-orientation android-orientation thread-sleep

try{
            screenOn = intent.getBooleanExtra("screen_state", false);
            rotation = intent.getStringExtra("rotation");
            orientation = intent.getStringExtra("orientation");

        }catch(Exception e){}


        if (!screenOn) {



        } else {


            if(rotationChecker){
                Log.e("TAG","String orientationRotation above unlock");
                UnLocker();
            }
            rotationChecker=true;
            //
            //
            new Handler().postDelayed(new Runnable() {

                @Override
                public void run() {
                    Log.e("TAG","String orientationRotation in run");
                    // TODO Auto-generated method stub
                    rotationChecker=false;
                }
            }, TIME_DELAYED);

我想在time_delayed和rotationchecker为真时调用解锁函数,但我的代码无效。我需要能够跟踪最后方向和最后一次旋转的代码,并与TIME_DELAYED值内的新旋转和方向值进行比较然后它应该调用解锁功能

0 个答案:

没有答案