0
Hello I am new learning Kotlin and I have the following problem, I have a View image with two buttons, move forward and backward. In a gallery of 5 photos I would like to keep exchanging images so that one button forward an image and the other back. Someone can help?
That’s my mainactivity code
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.ImageView
class MainActivity : AppCompatActivity() {
lateinit var img01: ImageView
val imgs = intArrayOf(
R.drawable.p0,
R.drawable.p1,
R.drawable.p2,
R.drawable.p3,
R.drawable.p4,
R.drawable.p5,
R.drawable.p6,
)
val x = 0
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
img01 = findViewById(R.id.img01)
}
fun anterior(view: View) {
}
fun proximo(view: View) {
}
}```