I know this is wrong pls help Search all over Yt and nothing on how to do it :( need to learn how to use maths with Variable
package com.example.myapplication
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.TextView
import kotlinx.android.synthetic.main.activity_calc.*
class Calc : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_calc)
var need = findViewById<TextView>(R.id.t_need)
var money = findViewById<TextView>(R.id.t_money)
var debt = findViewById<TextView>(R.id.t_debt)
var b_calc = findViewById<TextView>(R.id.b_calc)
b_calc.setOnClickListener {
val diffrence = Money - debt
need.text = diffrence
}
}
}