Advertisement
Diaxon

Main.kt

Oct 22nd, 2023
1,052
0
154 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.63 KB | None | 0 0
  1. package com.example.zadanie8_1
  2.  
  3. import androidx.appcompat.app.AppCompatActivity
  4. import android.os.Bundle
  5. import android.widget.EditText
  6. import android.widget.TextView
  7.  
  8. class MainActivity : AppCompatActivity() {
  9.     override fun onCreate(savedInstanceState: Bundle?) {
  10.         super.onCreate(savedInstanceState)
  11.         setContentView(R.layout.activity_main)
  12.  
  13.         val text = findViewById<EditText>(R.id.textView).text.toString()
  14.         val textView = findViewById<TextView>(R.id.editTextNumber)
  15.  
  16.         textView.text = resources.getQuantityString(R.plurals.plurals, text.toInt(), text.toInt())
  17.                
  18.  
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement