質問

I want to increment int variable when I for e.g. swipe to the right, it's possible? I have swipe control code like this ant I want to increment variable myint.

  public void onRightToLeftSwipe(){
            Log.i(logTag, "RightToLeftSwipe!");
            myint = myint + 1;
        }
役に立ちましたか?

解決

I assume your question is where to call this sample method to increase the variable, right?

You need to find a callback which you receive after the swipe and invoke the method there. Depending on how you implement your swipe, your callback can be different (do you implement the swipe yourself or you used a third-party component for it?)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top