Subscribed unsubscribe Subscribe Subscribe

Mobile App Dev Diary

Android (Java, Kotlin), iOS (Swift), Xamarin (C#)

Kotlin 1.1 / Screen transition with Intent

Screen transition in Kotlin version 1.1. When you transite to “NextActivity”, use this. val intent = Intent(applicationContext, NextActivity::class.java) startActivity(intent) Or you may want to define package-level function to instantiate…

Kotlin 1.1 / Display Toast

Display Toast in Kotlin version 1.1. Short-duration. Toast.makeText(this, "Good morning!", Toast.LENGTH_SHORT).show() Long-duration. Toast.makeText(this, "Good evening!", Toast.LENGTH_LONG).show()

Kotlin 1.1 / setOnClickListener

Set “setOnClickListener” to Button in Kotlin version 1.1. val myButton: Button = findViewById(R.id.menu_camera) as Button myButton.setOnClickListener { //onClick }