Last active
July 30, 2016 15:59
-
-
Save code-crusher/3946d9852e5319e587887d012009dfd9 to your computer and use it in GitHub Desktop.
Kotlin Demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class KotlinActivity : AppCompatActivity() { | |
val text = "Made with Kotlin" | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_kotlin) | |
init() | |
} | |
private fun init() { | |
val toolbar = findViewById(R.id.toolbar) as Toolbar? | |
setSupportActionBar(toolbar) | |
val fab = findViewById(R.id.fab) as FloatingActionButton? | |
fab!!.setOnClickListener { openRepo() } | |
} | |
private fun openRepo() { | |
val url = "https://github.com/code-crusher/KAndy" | |
val i = Intent(Intent.ACTION_VIEW) | |
i.data = Uri.parse(url) | |
startActivity(i) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment