Question

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;
        }
Était-ce utile?

La solution

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?)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top