0

Ok。だから私はジェスチャーなどを少し見ていて、左スワイプのようなことが起こったときに新しい画面を開いて右スワイプと同じようにコードを設定する方法を見つけようとしています。カレンダーのようなもので、日をスワイプできます。私はすでにジェスチャーを作成しています。助けてくれてありがとう。

4

2 に答える 2

0

Ok。私は何かを思いついたと思います。今は十分に試すことができませんが、正しく見えますか?ありがとう。

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();}

            }
        }
于 2010-12-07T00:36:00.160 に答える
-1
Intent intent = new Intent(this, MyActivity.class);
startActivity(intent);

ジェスチャをリッスンするためのドキュメントを参照してください。

于 2010-12-07T00:07:36.093 に答える