Hello, i am very new at kotlin and i am wondering how i can add an second button (the function from the button not the button itself) to my MainActivity. I already have one but idk how to add a second one. Can someone maybe help me there?
The code from the MainActivity:
package com.example.myapplication
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.webkit.WebView
import android.widget.Button
class MainActivity2 : AppCompatActivity()
{
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main2)
val VerButton = findViewById<Button>(R.id.button3)
VerButton.setOnClickListener {
val Intent = Intent(this, MainActivity::class.java)
startActivity(Intent)
}
}
}