Advertisement
Diaxon

Untitled

Oct 1st, 2023
178
0
120 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. package com.example.myapplication
  2.  
  3. import android.widget.TextView
  4. import android.widget.EditText
  5. import android.widget.Button
  6.  
  7. import androidx.appcompat.app.AppCompatActivity
  8. import android.os.Bundle
  9. import android.view.View
  10.  
  11. class MainActivity : AppCompatActivity() {
  12.  
  13. override fun onCreate(savedInstanceState: Bundle?) {
  14. super.onCreate(savedInstanceState)
  15. setContentView(R.layout.activity_main)
  16.  
  17. val displayEmailTextView: TextView = findViewById(R.id.displayEmailTextView)
  18. val emailEditText: EditText = findViewById(R.id.emailEditText)
  19.  
  20. findViewById<Button>(R.id.submit).setOnClickListener {
  21. displayEmailTextView.text = "Twój adres e-mail to: ${emailEditText.text}"
  22.  
  23. }
  24.  
  25.  
  26.  
  27. }
  28. fun newView(view: View){
  29. setContentView(R.layout.new_layout)
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement