https://kotlinlang.org logo
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
  • g

    gildor

    06/22/2017, 4:58 PM
    @aakaashjois No, currently it's impossible. You can do that using ClassName.Companion.yourExtension() but it works only for classes with Companion object
    a
    • 2
    • 1
  • m

    mohsenoid

    06/23/2017, 9:07 AM
    I am using Dagger for injection and using this code for injecting classes into my Activity:
    @field:[Inject ApplicationContext]
    lateinit var context: Context
    but
    lateinit
    does not work with primitive data types like
    Boolean
    , how can I do something like this?
    @field:[Inject Named(QualifiersNames.IS_DEMO)]
    lateinit var isDemo: Boolean = false
    when I remove
    lateinit
    from it I get this error
    Dagger does not support injection into private fields
    • 1
    • 1
  • m

    menegatti

    06/23/2017, 9:11 AM
    I suppose you could use the
    NotNull()
    delegate to handle that scenario instead of
    lateinit
    m
    • 2
    • 2
  • s

    sikanderbhutto

    06/23/2017, 12:00 PM
    what is different val and var
    v
    l
    • 3
    • 3
  • m

    Marc

    06/23/2017, 1:36 PM
    by downloading the last version `canary 4`of the AS 3 now when i'm trying to execute my code seems that the ide can not find the references to nothing for instance:
    Error:(5, 28) Unresolved reference: domain
    where domain is a module. Have you got any clue?
    b
    r
    • 3
    • 5
  • v

    vivekneel

    06/23/2017, 10:30 PM
    Hello , How can i convert custom class to a type that room can recognise and persist , afaik room persist only primitive data type. I have something like this :
    @Entity(tableName = CricketConfig.TABLE_NAME)
    data class CricketModel(@PrimaryKey(autoGenerate = true) var id : Int = 0 ,@SerializedName("matches") var matches: List<Match> = emptyList())
    Now i need to convert
    List<Match>
    to a type that room can recognize , any idea on how to achieve this?
    g
    • 2
    • 1
  • r

    rockerhieu

    06/24/2017, 6:29 AM
    I just switched to kotlin-kapt, tried with and without
    kapt { generateStubs = true }
    , still same issue. I doubt it is a problem as @vivekneel mentioned as the code worked fine before enabling kotlin
    g
    • 2
    • 1
  • g

    gildor

    06/24/2017, 6:45 AM
    There is definitely some bug in you code or annotation processing configuration. Maybe you could provide full error log from Gradle
    r
    • 2
    • 1
  • a

    anton.golovin

    06/24/2017, 8:29 PM
    Hi all, Just updated to version 1.1.3 and now have this compilation error report:
    annotation @ActivityKey is missing a default value for the element 'value'
    incompatible types: NonExistentClass cannot be converted to Annotation
    java.lang.IllegalStateException: failed to analyze: org.jetbrains.kotlin.kapt3.diagnostic.KaptError: Error while annotation processing
    Doesn’t work with Dagger 2 for me. Does anybody know what the problem?
    o
    p
    g
    • 4
    • 4
  • m

    mithuroy

    06/25/2017, 5:29 AM
    org.mockito.exceptions.base.MockitoException: Cannot mock/spy class com.mithuroy.mvparchitecture.LoginService Mockito cannot mock/spy following: - final classes - anonymous classes - primitive types
    m
    • 2
    • 2
  • m

    mithuroy

    06/25/2017, 5:32 AM
    I don't know whether Kotlin is converting anything internally, any help would be great.
    s
    p
    • 3
    • 3
  • a

    aakaashjois

    06/25/2017, 6:24 AM
    Kotlin version that is used for building with Gradle (1.1.2-5) differs from the one bundled into the IDE plugin (1.1.2-4)
    . I get this warning. Should I roll back my Kotlin version?
    m
    s
    • 3
    • 9
  • t

    takagis

    06/25/2017, 10:56 AM
    Hi all, I updated to Kotlin 1.1.3 with Andorid Studio 2.3.3(macOS Sierra 10.12.5) and have had Android Studio freeze many times today. Does anybody know what the problem?
    t
    • 2
    • 2
  • m

    mrzak-dev

    06/25/2017, 10:02 PM
    can we eork with kotlin alongside php in android studio ?
    l
    v
    • 3
    • 5
  • c

    Christian Maier

    06/26/2017, 9:18 AM
    Does anyone know how to enable Semantic Highlighting and Parameter Name Hints in Android Studio 2.3.3?
    👍 1
    t
    l
    • 3
    • 3
  • s

    sandeep

    06/26/2017, 9:20 AM
    I am new to both Android and Kotlin(been doing some kotlin though), can someone point me to a good video tutorials where I can learn android and kotlin ?
    r
    • 2
    • 1
  • j

    jmfayard

    06/26/2017, 10:34 AM
    I think I had the problem, found on stack overflow that if you add a space in the manifest file and retry, it works
    r
    l
    • 3
    • 3
  • c

    charlae4ive

    06/26/2017, 2:57 PM
    whats that?
    b
    m
    • 3
    • 4
  • c

    charlae4ive

    06/26/2017, 2:57 PM
    WOW. where can i get the conversion tool?
    m
    v
    • 3
    • 6
  • k

    kevmoturi

    06/26/2017, 4:08 PM
    @charlae4ive https://try.kotlinlang.org/#/Kotlin%20Koans/Introduction/Hello,%20world!/Test.kt
    c
    • 2
    • 3
  • i

    ihor_kucherenko

    06/27/2017, 7:36 AM
    https://proandroiddev.com/android-architecture-components-cb1ea88d3835
    👍 2
    g
    • 2
    • 2
  • k

    kevmoturi

    06/27/2017, 3:51 PM
    So question for android devs using kotlin, has the lack of checked exceptions resulted in any major issues? I am thinking even though checked exceptions get abused and ignored in java, not having the ability to know when a method may throw an exception is kind of dangerous
    p
    • 2
    • 1
  • m

    mithuroy

    06/27/2017, 7:47 PM
    I started taking this course from today on Udemy, do you think it's worth my time? https://www.udemy.com/the-complete-kotlin-developer-course
    t
    • 2
    • 2
  • h

    hetang

    06/27/2017, 7:50 PM
    ratings looks legit
    m
    • 2
    • 1
  • s

    sidharthanil

    06/28/2017, 1:42 PM
    Hi, I have a doubt, How do we call an interface method in fragment from parent activity in kotlin. When I try to do that it says the interface object must be initialised
    g
    • 2
    • 11
  • v

    vivekneel

    06/28/2017, 3:40 PM
    Hey guys, Regarding firebase remote config: Any idea why do we need the
    default_remote_config.xml
    stored locally in res/xml/
    s
    • 2
    • 1
  • k

    kokeroulis

    06/29/2017, 7:30 AM
    hello, i am trying to use reflection inside kotlin, but the build fails showing that
    e: java.lang.NullPointerException
    * What went wrong:
    Execution failed for task ':app:kaptDebugKotlin'.
    > Internal compiler error. See log for more details`
    r
    • 2
    • 3
  • m

    martindg

    06/29/2017, 3:10 PM
    People, somebody has the latest version of Antonio Leiva Book about Kotlin? Kotlin for android developers on EPUB version?
    m
    • 2
    • 2
  • m

    martindg

    06/29/2017, 3:25 PM
    I want to know if it's good book or not? kkkkk of course he is going to said yes! but prefer people comment about it
    l
    • 2
    • 2
  • m

    menegatti

    06/29/2017, 3:30 PM
    you could fix the whole thing, I believe, by doing
    val picker: NumberPicker = view.findViewById(R.id.picker)
    s
    • 2
    • 1
Powered by Linen
Title
m

menegatti

06/29/2017, 3:30 PM
you could fix the whole thing, I believe, by doing
val picker: NumberPicker = view.findViewById(R.id.picker)
s

smilecs

07/03/2017, 4:17 PM
why not use extensions?
View count: 2