Skip to content

Instantly share code, notes, and snippets.

🤒
Out sick

Abdurrokhman arjava

🤒
Out sick
Block or report user

Report or block arjava

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@arjava
arjava / convert UTC to GMT time in Kotlin
Last active Apr 22, 2018
snippet code for convert UTC to GMT using Kotlin
View convert UTC to GMT time in Kotlin
override fun convertToGmt() {
val sdfTime = SimpleDateFormat("HH:mm:ss")
sdfTime.timeZone = TimeZone.getTimeZone("UTC")
val dateTime = scheduleMatch.timeMatch
val gmtTime = sdfTime.parse(dateTime).toString()
println(gmtTime)
}
@arjava
arjava / back-handling-kotlin
Created Mar 27, 2018
Handling back button in kotlin
View back-handling-kotlin
override fun onOptionsItemSelected(item: MenuItem?) = when (item?.itemId) {
android.R.id.home -> consume { finish() }
else -> super.onOptionsItemSelected(item)
}
private inline fun consume(f: () -> Unit): Boolean {
f()
return true
}
You can’t perform that action at this time.