MainActivity.kt package com.example.jetpack import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import kotlinx.android.synthetic.main.activity_main.* class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) // text to reverse val text = "ANDROID DEVELOPERS" // switch button checked change listener switchButton.setOnCheckedChangeListener { compoundButton, b -> if (b){ // when switch button is checked textView.text = "Switch is on." textView.append("\n\n${text.reversed()}") }else{ // if switch button is unchecked textView.text = "Switch is off." textView.append("\n\n$text") } } } } activity_ma...
Android, .NET C#, Flutter, and Many More Programming tutorials.