Pregunta

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;
        }
¿Fue útil?

Solución

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top