Skip to content

Instantly share code, notes, and snippets.

View KhomDrake's full-sized avatar

Vinicius Viana KhomDrake

View GitHub Profile
fun makeSomething(argument: Int) : Int {
// do some stuff
}
fun makeSomething() {
// do some stuff
}
@KhomDrake
KhomDrake / hello-world-2.kt
Created January 30, 2022 16:53
Coroutines Example 2
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
fun main(args: Array<String>) {
GlobalScope.launch {
delay(1000L)
println("World!")
printThread()
}
@KhomDrake
KhomDrake / threads-hello-world.kt
Created January 30, 2022 16:19
Threads Hello World
import kotlin.concurrent.thread
fun main(args: Array<String>) {
thread {
Thread.sleep(1000L)
println("World!")
}
println("Hello,")
Thread.sleep(2000)
@KhomDrake
KhomDrake / coroutine-example-1.kt
Last active January 30, 2022 15:58
Coroutine Hello World Example
import kotlinx.coroutines.*
fun main() {
GlobalScope.launch {
delay(1000L)
println("World!")
}
println("Hello,")
Thread.sleep(2000)
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/navigation_cinema"
android:icon="@drawable/ic_cinema_black_24dp"
android:title="@string/title_movies" />
<item
android:id="@+id/navigation_tv"
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/navigation_cinema"
android:icon="@drawable/ic_cinema_black_24dp"
android:title="@string/title_movies" />
<item