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
  • u

    Udit003

    08/17/2018, 11:49 AM
    I am struggling to understand how to use dagger dependency injection , in a kotlin architectural component based app. Even after going through many blog posts, docs , I still dont clearly understand field injection, dagger-android . Can anyone suggest any course or material which might help me to get a better understanding of dagger so that I can move fast with my development.
    :stackoverflow: 2
    :google: 2
    j
    • 2
    • 4
  • i

    ibraiz_teamo

    08/18/2018, 11:22 AM
    @jw can you convert the above discussion in a blog post?...for reference.
    l
    • 2
    • 1
  • j

    Jakub

    08/18/2018, 5:06 PM
    nothing special, I need simple logger consistent with kotlin syntax
    p
    • 2
    • 1
  • l

    Lucas Ł

    08/18/2018, 5:36 PM
    Give
    Timber
    a try
    j
    n
    l
    • 4
    • 8
  • a

    Ayden

    08/18/2018, 5:48 PM
    Would like to hear some feedback from you.
    j
    • 2
    • 6
  • t

    twisterrob

    08/18/2018, 10:24 PM
    message has been deleted
    s
    e
    • 3
    • 3
  • j

    Jakub

    08/19/2018, 7:17 PM
    What’s the best way to implement matching strings with typos in Android? Is there a native implementation or 3rd part library?
    :stackoverflow: 2
    • 1
    • 1
  • t

    Tony Hoyle

    08/19/2018, 7:28 PM
    There are soundex libraries for android, but I'm not aware of anything kotlin specific
    j
    l
    • 3
    • 3
  • d

    Daniele Segato

    08/20/2018, 8:10 AM
    I've upgraded to recently released navigation component alpha05 and this error popped up:
    Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
    public fun `Activity;`.findNavController(viewId: Int): `NavController;` defined in androidx.navigation
    public fun `View;`.findNavController(): `NavController;` defined in androidx.navigation
    This means my previously working code doesn't compile anymore on this stuff:
    view.setOnClickListener {
        it.findNavController().navigate(somewhere)
    }
    cause it cant resolve
    findNavController()
    extension function. I think it's a collision? Checked the source code
    package androidx.navigation
    
    import android.view.View
    /**
     * Find a [NavController] associated with a [View].
     *
     * Calling this on a View not within a [NavHost] will result in an
     * [IllegalStateException]
     */
    fun View.findNavController(): NavController =
            Navigation.findNavController(this)
    and
    package androidx.navigation
    import android.app.Activity
    import android.support.annotation.IdRes
    /**
     * Find a [NavController] given the id of a View and its containing
     * [Activity].
     *
     * Calling this on a View that is not a [NavHost] or within a [NavHost]
     * will result in an [IllegalStateException]
     */
    fun Activity.findNavController(@IdRes viewId: Int): NavController =
            Navigation.findNavController(this, viewId)
    these two collide I think and when you
    import androidx.navigation.findNavController
    it doesn't know which one to import?
    l
    • 2
    • 4
  • j

    josefrichter

    08/20/2018, 1:56 PM
    quick dumb question please> is there an Android equivalent of ios “page control” please? you know those dots at the bottom of the screen, typically in onboarding, etc.
    :stackoverflow: 6
    g
    • 2
    • 5
  • g

    gildor

    08/21/2018, 8:03 AM
    Exactly, you should worry about design, not about one empty class. Otherwise you should stop using any Lists and especially Maps It is not “a huge overhead” it no practical overhead at all. On your app initialisation even before any UI you create hundreds and thousands classes with state (not just empty, like in you case). Overhead is so small that no reason to worry about it in such case. Spend your time to solve real problems and do real optimisation rather than worry about one global object
    ➕ 2
    r
    • 2
    • 7
  • i

    igor.wojda

    08/21/2018, 1:23 PM
    Hey What is the best way to deal with button clicks debouncing and Kotlin Android Extensions? Is there any simple way to debounce clicks for whole app?
    l
    • 2
    • 2
  • h

    hallvard

    08/21/2018, 1:52 PM
    Did we remember to praise LeakCanary today? https://github.com/square/leakcanary
    p
    • 2
    • 1
  • u

    ursus

    08/21/2018, 3:58 PM
    hey guys, do background limits apply to location in periodic job scheduler, right? docs says it gives me fresh location in background only few times an hours can someone confirm this?
    :stackoverflow: 4
    l
    j
    • 3
    • 3
  • s

    Slackbot

    08/21/2018, 6:27 PM
    This message was deleted.
    🤦‍♀️ 1
    l
    n
    • 3
    • 12
  • p

    pankaj

    08/21/2018, 7:27 PM
    only one
    m
    l
    • 3
    • 5
  • p

    Paul Woitaschek

    08/22/2018, 9:25 PM
    @louiscad always advocates his "splitties". I find them way cleaner than anko
    👌 1
    l
    • 2
    • 1
  • p

    Paul Woitaschek

    08/22/2018, 9:54 PM
    What does flutter do different that they always wave their 60fps claim?
    l
    • 2
    • 1
  • k

    Kevin Janvier Chinabalire

    08/23/2018, 7:16 AM
    Anyone using room database in kotlin? How do you clear all tables ?
    :stackoverflow: 1
    l
    • 2
    • 3
  • k

    Kevin Janvier Chinabalire

    08/23/2018, 7:30 AM
    @Kulwinder Singh i implemented that but getting
    java.lang.IllegalStateException: Cannot perform this operation because there is no current transaction.
    It run for the first time then crash for second time
    fun clearAndResetAllTables(): Boolean {
            if (db== null) return false
    
            // reset all auto-incrementalValues
            val query = SimpleSQLiteQuery("DELETE FROM sqlite_sequence")
    
            db!!.beginTransaction()
            return try {
                db!!.clearAllTables()
                db!!.query(query)
                db!!.setTransactionSuccessful()
                true
            } catch (e: Exception){
                false
            } finally {
                db!!.endTransaction()
            }
        }
    :stackoverflow: 1
    g
    d
    • 3
    • 9
  • a

    Ayokunle Paul

    08/23/2018, 9:18 AM
    Anyone here with a good resource to learning clean architecture?
    :google: 5
    k
    j
    • 3
    • 5
  • d

    Denis A

    08/23/2018, 3:29 PM
    Hi to all, i’m writing library from RecyclerView. Today i released new version. Please, look at this and note, what we think about it. Thanks! https://github.com/mentalstack/recyclerview-extensions
    m
    • 2
    • 2
  • p

    Parshav

    08/23/2018, 5:35 PM
    For a template app that has a bunch of product flavors (talking 20+ and increasing), is there a different / more efficient way to manage product flavors instead of having blocks of code for each in the gradle file ?
    a
    • 2
    • 1
  • n

    neuber

    08/23/2018, 11:41 PM
    https://kotlinlang.slack.com/archives/C0B8M7BUY/p1534876025000100
    d
    n
    • 3
    • 2
  • s

    Slackbot

    08/24/2018, 5:16 AM
    This message was deleted.
    👎 1
    e
    g
    +2
    • 5
    • 20
  • l

    leosan

    08/24/2018, 10:50 AM
    private val imageResource: Int? by lazy { arguments?.getInt(ARG) }
    //Doesn't work compiler complain it is not integer
    imageResource?.let { ivIcon.setImageResource(it) }
    //Works
    imageResource?.run { ivIcon.setImageResource(this) }
    is there a way to use the `@DrawableRes`with delegates? or do I have to lose the perk of using
    setImageResource
    ? Edit: It works with
    run
    what am I missing here?
    d
    • 2
    • 4
  • v

    Viktor Vostrikov

    08/25/2018, 2:43 PM
    Hello, I have a real problem. I have previously used MediatorLiveData to combine results from FCM, Room and Networking in my Repository. It worked well. However, now I want more complexity and some additional bonuses from RxJava. This is why I have decided to use RxJava this time. I can combine Room and Networking with Observable.concatArrayEager(my _observables) or merge them all, but then I can't get the latest one, which in this case what I want. However, I don't now how to do that after FCM pushes value, and how should I notify my main observable after new changes occur? No examples on this issue whatsoever. It is crucial part. I receive FCM in my BroadCastReceiver and then notified my repository's livedata, which notified my MediatorLiveData... How to do that with RxJava? Would really welcome any advice, because it is really important issue.
    :java: 3
    :stackoverflow: 8
    m
    • 2
    • 1
  • w

    wck

    08/27/2018, 5:45 AM
    Hi, how do you deal with
    Mockito.any(T::class.java)
    return null in Kotlin?
    g
    m
    +2
    • 5
    • 6
  • z

    zone

    08/27/2018, 7:19 AM
    Hi any article or guide to use coroutine with Room database and retrofit with repository pattern?
    l
    • 2
    • 1
  • g

    g4sarma

    08/27/2018, 10:45 AM
    Hey guys
    l
    • 2
    • 3
Powered by Linen
Title
g

g4sarma

08/27/2018, 10:45 AM
Hey guys
l

louiscad

08/27/2018, 10:47 AM
Hi @g4sarma, please, do one message instead of tons of small messages here (unless you're in a thread), we are 16K+ in there
g

g4sarma

08/27/2018, 10:49 AM
@louiscad sorry about that will keep in mind
👍 1
l

louiscad

08/27/2018, 10:50 AM
Also, make use of
code formatting
with backticks
View count: 2