hamidms

inikoding_toast_kootlin_ActivityMain

Sep 24th, 2018
469
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.55 KB | None | 0 0
  1. import android.support.v7.app.AppCompatActivity
  2. import android.os.Bundle
  3. import android.support.design.widget.Snackbar
  4. import kotlinx.android.synthetic.main.activity_main.*
  5.  
  6. class MainActivity : AppCompatActivity() {
  7.  
  8.     override fun onCreate(savedInstanceState: Bundle?) {
  9.         super.onCreate(savedInstanceState)
  10.         setContentView(R.layout.activity_main)
  11.  
  12.         button_snackbar.setOnClickListener {
  13.             val snackbar = Snackbar.make(it, "Halo Selamat Pagi", Snackbar.LENGTH_LONG)
  14.             snackbar.show()
  15.         }
  16.     }
  17. }
Add Comment
Please, Sign In to add comment