So my problem is, when I try to call my button it doesn't work and gives me an error saying "Unresolved Reference":
So my problem is, when I try to call my button it doesn't work and gives me an error saying "Unresolved Reference":
Initialize your button in the Kotlin file, MainActivity.kt or whatever you named it.
Button btn_start = (Button) findViewById(R.id.btn_start);
btn_start.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick (View v) {
}
});
This is in Java because I don't know Kotlin, but hopefully it's easy to translate.
Also note: you can add codeblocks in your question. Please do so as it makes it convenient for everyone.