|
|
@ -11,14 +11,13 @@ import androidx.appcompat.app.AppCompatActivity
|
|
|
|
import io.flutter.embedding.android.FlutterActivity
|
|
|
|
import io.flutter.embedding.android.FlutterActivity
|
|
|
|
|
|
|
|
|
|
|
|
class MainActivity : AppCompatActivity() {
|
|
|
|
class MainActivity : AppCompatActivity() {
|
|
|
|
private var counterLabel: TextView? = null
|
|
|
|
private lateinit var counterLabel: TextView
|
|
|
|
|
|
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
|
super.onCreate(savedInstanceState)
|
|
|
|
super.onCreate(savedInstanceState)
|
|
|
|
setContentView(R.layout.activity_main)
|
|
|
|
setContentView(R.layout.activity_main)
|
|
|
|
|
|
|
|
|
|
|
|
counterLabel = findViewById(R.id.counter_label)
|
|
|
|
counterLabel = findViewById(R.id.counter_label)
|
|
|
|
|
|
|
|
|
|
|
|
val button = findViewById<Button>(R.id.launch_button)
|
|
|
|
val button = findViewById<Button>(R.id.launch_button)
|
|
|
|
|
|
|
|
|
|
|
|
button.setOnClickListener {
|
|
|
|
button.setOnClickListener {
|
|
|
@ -32,6 +31,6 @@ class MainActivity : AppCompatActivity() {
|
|
|
|
override fun onResume() {
|
|
|
|
override fun onResume() {
|
|
|
|
super.onResume()
|
|
|
|
super.onResume()
|
|
|
|
val app = application as MyApplication
|
|
|
|
val app = application as MyApplication
|
|
|
|
counterLabel?.text = "Current count: ${app.count}"
|
|
|
|
counterLabel.text = "Current count: ${app.count}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|