Hello, i am very new at kotlin and i am wondering ...
# android
m
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) } } }
đŸ˜¶ 3
c
Hi Moritz, this is the wrong workspace to ask such questions. This workspace and specially this channel is for specific Kotlin related questions. Yours is more like a general “How do I implement something on Android”. Those questions are better ask in one of the links form the channel description.