Advertisement
AzisMM

MainActivity2.kt

Feb 7th, 2024 (edited)
1,676
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.64 KB | None | 0 0
  1. package com.azis.learn
  2.  
  3. import androidx.appcompat.app.AppCompatActivity
  4. import android.os.Bundle
  5. import android.widget.TextView
  6.  
  7. class MainActivity2 : AppCompatActivity() {
  8.     override fun onCreate(savedInstanceState: Bundle?) {
  9.         super.onCreate(savedInstanceState)
  10.         setContentView(R.layout.activity_main2)
  11.  
  12.         val textB : TextView = findViewById(R.id.SaveText)
  13.  
  14.         // Menerima teks yang dikirimkan dari ActivityB
  15.         val textFromActivityB = intent.getStringExtra("textFromMainActivity2")
  16.  
  17.         // Menampilkan teks di TextView atau melakukan aksi lainnya
  18.         textB.text = textFromActivityB
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement