Permalink
Browse files

Merge branch 'feature/variables' into develop

  • Loading branch information...
gonzapico committed Apr 22, 2017
2 parents 73d8988 + e789349 commit 577660605b8baa6cdc2d22091f051cf7901923a7
@@ -1,12 +1,26 @@
package xyz.gonzapico.myfirstkotlinapp
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.widget.TextView
class HomeActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_home)
val tvWelcomeMessage = findViewById(R.id.tvWelcomeMessage) as TextView
tvWelcomeMessage.setText(resources.getString(R.string.welcomeMessage))
// Casting example
val myInt = 20
val myLong: Long = myInt.toLong()
// Inference
val myVal = 20.0
val long = 20L
}
}
@@ -8,6 +8,7 @@
tools:context="xyz.gonzapico.myfirstkotlinapp.HomeActivity">
<TextView
android:id="@+id/tvWelcomeMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
@@ -1,3 +1,4 @@
<resources>
<string name="app_name">MyFirstKotlinApp</string>
<string name="welcomeMessage">Hello Kotlin!!!</string>
</resources>

0 comments on commit 5776606

Please sign in to comment.