2
I’m trying to set up a toggle switch in android studio using Lottie documentation. I got it, but this making a mistake, I need a little help guys.
final boolean[] oontrole = {false};
final LottieAnimationView animationView = (LottieAnimationView) findViewById(R.id.animation_view);
animationView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(oontrole[0]) {
animationView.setAnimation("androidDesliga.json");//animação botao desligando
animationView.playAnimation();
oontrole[0] = false;
} else {
animationView.setAnimation("androidLiga.json");//animação botao ligando
animationView.playAnimation();
oontrole[0] = true;
}
}
});
Be more specific, what is the error generated?
– Samuel Fontebasso