Hi everyone;
I am trying to create an Android app with Android Studio (Kotlin) ladybug, last version.
I want to create a hockey app. I want the app to record my hockey shifts (number and time), skating time, skating distance, skating speed.
I started with an empty activity projet, so I erased the hello world thingies.
I have my main actitivity below.
Here I am:
package com.example.myapp2
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.enableEdgeToEdge
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContentView(R.layout.activity_main)
}
}
On my activity_main.xlm, I have two buttons, patinage libre and match (free skating and play a game).
When I click the free skating button, I want it to (I guess) open a new actvity and display my skating data, from the phone (and later also from the watch).
I thnink I need the setonclick button fonction but I don’t know how to do that, could anyone help ?
Thanks so much
PS : so far the app is running properly, took me 10 days to get there…