https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
android
  • k

    kreatio

    05/26/2017, 12:57 PM
    this happens only when I switch from debug to release flavor
    b
    z
    • 3
    • 3
  • b

    bachhuberdesign

    05/26/2017, 2:52 PM
    Anyone here tried Room yet? Is it stable enough to use in a production app? Our cache is getting too unwieldy so we’re moving one of our apps from raw files -> SQLite
    👍 1
    d
    t
    +2
    • 5
    • 13
  • c

    Casey Kulm

    05/26/2017, 4:18 PM
    @aphex There is a ConstraintLayout slack channel?
    z
    • 2
    • 1
  • a

    anstaendig

    05/26/2017, 4:55 PM
    Anyone here tried out the LiveData in kotlin? Having a hard time setting it up or rather instantiating it in my activity
    z
    i
    • 3
    • 5
  • g

    gjesse

    05/27/2017, 12:59 AM
    if i was gonna get started on android dev, any recommendations on a good cheap device to start out with? something with gps at least...
    f
    d
    • 3
    • 13
  • a

    anstaendig

    05/27/2017, 7:13 AM
    Anyone here worked with AndroidArchitecture ViewModels and the Dagger2-Android ActivitySubComponent approach? I just can't get my head around how to add the viewmodel to the dependency graph
    i
    • 2
    • 2
  • d

    Dalinar

    05/28/2017, 7:32 AM
    can pressing the volume up or down buttons on a bluetooth speaker be detected? I assume you must be able to handle the play/pause button
    :stackoverflow: 7
    • 1
    • 1
  • k

    kirillrakhman

    05/28/2017, 9:31 PM
    and with some luck, proguard will convert enums to ints https://www.guardsquare.com/en/proguard/manual/optimizations
    l
    • 2
    • 1
  • a

    aaron_c

    05/28/2017, 10:11 PM
    Using anko, wanting to have a list that reacts to the contents. I get that I want to make it observable, and I think I've done that, but it's not updating as I change it.
    d
    • 2
    • 2
  • r

    ra1nmak3r

    05/29/2017, 1:43 AM
    Is it better to use Kt Android Extensions or Delegated properties? 🤔
    i
    • 2
    • 3
  • c

    cubesky

    05/29/2017, 7:26 AM
    Hello, I have a problem when I use Kotlin in Android. I create a handler using
    kotlin
    val handler: Handler = object : Handler() {
            override fun handleMessage(msg: Message) {
                when (msg.what) {
                    0 -> { fab_next.show() }
                }
                super.handleMessage(msg)
            }
        }
    and Android Studio told me
    This Handler class should be static or leaks might occur
    ,but kotlin doesn't have
    static
    ,So what should I do for this?
    l
    • 2
    • 2
  • c

    cubesky

    05/29/2017, 8:15 AM
    Thank you, I just successfully using this to solve leak problem. IDE check is passed
    👍 1
    a
    • 2
    • 1
  • p

    pawel.rybicki

    05/29/2017, 10:00 AM
    do you have any ideas? : )
    w
    • 2
    • 4
  • n

    nekoinemo

    05/29/2017, 1:36 PM
    Hello. Can you recommend a good ORM with Kotlin support/extensions? I tried DBFlow (which has Kotlin extensions) but its latest 4.0.2 was way too rough to be usable.
    d
    m
    • 3
    • 10
  • m

    mg6maciej

    05/29/2017, 4:22 PM
    I've put on maven central a library depending on Google Maps Android API, but I just removed dependency from POM and added notes in readme that you need to add both this library and play-services-maps as dependency.
    w
    • 2
    • 2
  • k

    kirillrakhman

    05/29/2017, 4:22 PM
    but how did you even compile your code?
    r
    • 2
    • 1
  • a

    aaron_c

    05/29/2017, 8:03 PM
    @ontherunvaro Is it possible to convert a list to an Observable List?
    w
    i
    • 3
    • 3
  • m

    menegatti

    05/30/2017, 11:20 AM
    Have you guys played with class delegation in activities, for instance?
    i
    • 2
    • 5
  • t

    Tudor Luca

    05/30/2017, 7:02 PM
    I was trying “Show preview”
    a
    • 2
    • 3
  • v

    visruth

    05/31/2017, 7:47 AM
    Is there any Java library to convert Kotlin to JavaScript code? I have a String s = "contains Kotlin code"; which I want to convert to a JavaScript code? is it possible?
    m
    • 2
    • 4
  • d

    dzakens

    05/31/2017, 11:48 AM
    What I meant is when I add diposable to composite after restoring fragment from backstack onNext is not called
    i
    • 2
    • 1
  • a

    abanoub.wagdy91

    05/31/2017, 1:31 PM
    Hi Guys , Is there sample how to use RxJava in kotlin I have asked about this before and someone here sent me collection samples but i really lost it
    r
    a
    d
    • 4
    • 3
  • y

    yigit

    05/31/2017, 8:03 PM
    this problem seems to come back with 1.1.3-eap-34 & android gradle plugin 3.0.0-alpha2 https://youtrack.jetbrains.com/issue/KT-17642 I've also tried with top of tree android gradle plugin and same exception.
    k
    • 2
    • 1
  • t

    tamselvan89

    06/01/2017, 6:16 AM
    how to use the Butterknife in recyclerview ViewHolder
    :stackoverflow: 14
    r
    • 2
    • 1
  • t

    tamselvan89

    06/01/2017, 6:16 AM
    Butterknife.bind(this,itemView) not working
    m
    i
    • 3
    • 2
  • k

    kirillrakhman

    06/01/2017, 12:35 PM
    I'm trying to upgrade my android project to 3.0.0-alpha2 and I'm always getting
    Failed to resolve: Could not resolve project :myLibrary. Required by: project :app
    myLibrary
    being an android-lib project that's consumed by the
    app
    project
    l
    • 2
    • 3
  • e

    Eugen Martynov

    06/01/2017, 1:13 PM
    Observation - I can run instrumental test written in Kotlin when I run all from module
    k
    • 2
    • 4
  • e

    Eugen Martynov

    06/01/2017, 1:13 PM
    However I can not run single test from class in Kotlin
    😢 1
    m
    • 2
    • 8
  • m

    mattinger

    06/01/2017, 7:15 PM
    I'm having some trouble trying to activate kotlin in an Android project. My environment:
    Android Studio 2.3.2
    Gradle 3.3
    Kotlin 1.1.2-3
    Build Tools: 25.0.0
    Dagger 2.1
    Retrolambda 3.6.0
    Databinding 2.3.2
    b
    • 2
    • 1
  • m

    mattinger

    06/01/2017, 7:18 PM
    I setup the following in my app's build.gradle file:
    apply plugin: 'kotlin-android'
    apply plugin: 'kotlin-kapt'
    dependencies {
      kapt "com.google.dagger:dagger-compiler:2.1"
      kapt "com.android.databinding:compiler:$androidGradlePluginVersion"
      kapt "me.tatarka:gradle-retrolambda:3.6.0"
    }
    kapt {
      generateStubs = true
    }
    t
    s
    • 3
    • 8
Powered by Linen
Title
m

mattinger

06/01/2017, 7:18 PM
I setup the following in my app's build.gradle file:
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
dependencies {
  kapt "com.google.dagger:dagger-compiler:2.1"
  kapt "com.android.databinding:compiler:$androidGradlePluginVersion"
  kapt "me.tatarka:gradle-retrolambda:3.6.0"
}
kapt {
  generateStubs = true
}
t

trevjones

06/01/2017, 9:57 PM
mattinger: try removing
apply plugin: 'kotlin-kapt'
m

mattinger

06/02/2017, 12:34 AM
@trevjones doing that stops the databinding compiler from running altogether, so java files don't compile either.
s

stepango

06/02/2017, 2:27 AM
first of all remove
kapt {
  generateStubs = true
}
it's not needed for kapt 3 AFAIK kotlin does not work with retrolambda
m

mattinger

06/02/2017, 3:23 AM
i agree kotlin does not need retrolambda, but my java code needs it. It seems that i was actually chasing a ghost.
seems that the java -> kotlin converter did this for me:
@Inject private SettingsManager settingsManager
-->
@Inject internal var settingsManager: SettingsManager? = null
that's the actual problem.
I changed it to:
lateinit var settingsManager: SettingsManager
and it works.
i also changed the reference to my binding object to be a lateinit as well for good measure.
View count: 1