Frage

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;
        }
War es hilfreich?

Lösung

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top