Answers for "kotlin access layout component outside of Mainactivity"

0

kotlin access layout component outside of Mainactivity

doSomethingFunctionOrClass(activity: AppCompatActivity)
{
    var button = activity.findViewById<Button>(R.id.button)
    // if I try do something with button the app crashes eg
    button.text = "Text"
}
Posted by: Guest on March-10-2021

Code answers related to "kotlin access layout component outside of Mainactivity"

Browse Popular Code Answers by Language