用手势开始新活动

好。所以我一直在做一些看手势等等,并试图找出如何设置我的代码,以便当发生左滑动时,我可以打开一个新的屏幕,同样右键滑动。类似于日历的东西,你可以在这里刷过日子。我已经建立了手势。谢谢您的帮助。     
已邀请:
好。我想我想出了一些东西。我现在不能完全尝试,但它看起来是否合适?谢谢。
public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
        ArrayList<Prediction> predictions = mLibrary.recognize(gesture);
        if (predictions.size() > 0 && predictions.get(0).score > 1.0) {
            String action = predictions.get(0).name;

            if ("left".equals(action)) {
                Intent intent = new Intent(Actinium.this, Radium.class);
                startActivity(intent);
                finish();}
            else if  ("right".equals(action)) {
                Intent intent = new Intent(Actinium.this, Thorium.class);
                startActivity(intent);
                finish();}

            }
        }
    
Intent intent = new Intent(this, MyActivity.class);
startActivity(intent);
请参阅听取手势的文档。     

要回复问题请先登录注册