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

    Sam

    12/03/2020, 1:16 PM
    Hello everyone, how to know which parts ( libs/resources/modules etc) increase app size? Thanks
    c
    • 2
    • 6
  • j

    jean pokou

    12/03/2020, 3:14 PM
    Hi everyone, How can I create a custom RadioGroup like this one , I was able to change the check and uncheck drawable but I having trouble creating the clipped background
    o
    • 2
    • 4
  • s

    SanbosayDev

    12/03/2020, 3:19 PM
    can someone help me with this please I keep error about failed to complied value files
    j
    r
    • 3
    • 5
  • l

    luke_c

    12/03/2020, 4:31 PM
    Is there any reason I shouldn’t use GlobalScope in an Application scoped LifecycleObserver?
    g
    • 2
    • 1
  • s

    Sam

    12/03/2020, 10:13 PM
    hi super dumb question but how can i view a list of versions for a given gradle dependency? i am aware of android studio’s built in support but it only works for some dependencies and not others. is there some command line like
    gradle info com.googlecode.libphonenumber:libphonenumber
    ?
    v
    c
    l
    • 4
    • 72
  • g

    Goose

    12/04/2020, 5:15 AM
    However, I’m seeing an error with LiveData. Basically, saying LiveData is abstract (which makes sense) and
    Initializer is not allowed here because this property has no backing field
    n
    • 2
    • 1
  • y

    Yuri Drigin

    12/04/2020, 5:30 AM
    Shorter:
    val word: Live<String> = _word
    a
    a
    • 3
    • 4
  • c

    coroutinedispatcher

    12/05/2020, 10:41 AM
    Are there drawbacks to this approach? I want to do something similar. I have a
    LiveData
    and I want to make an extension function that transforms it to
    Flow
    (since I am using
    Flow
    all over the App) https://gist.github.com/chibatching/9fdd23d0d41980980a1c1af2e1803e01
    g
    • 2
    • 3
  • c

    Charlie Christensen

    12/05/2020, 5:38 PM
    With
    DataStore
    if I want to access a value synchronously the documentation says to use
    runBlocking
    like so
    runBlocking { dataStore.data.first() }
    Would I be able to instead use something like
    withContext(<http://Dispatchers.IO|Dispatchers.IO>) { dataStore.data.first() }
    What is the difference between those two approaches?
    a
    • 2
    • 3
  • f

    Florian

    12/06/2020, 8:56 AM
    Should error message in my UI be sticky (shown again on orientation change) or one-off events? Is it correct to say that one-off actions (i.e. suspending functions) should show one-off error messages (like a failed login attempt) and failed Flows (like a list not being able to load because of insufficient permissions) should show a sticky error message?
    s
    • 2
    • 2
  • t

    tylerwilson

    12/07/2020, 4:31 PM
    Using AS Arctic Fox with Kotlin 1.4.20 and all my collection methods have turned red, though it still builds. Anybody else see this?
    b
    m
    a
    • 4
    • 7
  • s

    Slackbot

    12/07/2020, 7:40 PM
    This message was deleted.
    m
    l
    a
    • 4
    • 6
  • l

    Lilly

    12/08/2020, 2:22 AM
    Hi, I wrap my head around a problem. I want to build a data class in relation to specific conditions. For instance:
    data class Test(val test1: Int, val test2: Int)
    This would be the base and if a specific condition is satisfied:
    data class Test(val test1: Int, val test2: Int, val test3: Int)
    I could create 2 separate data classes but then I always have to pass both and I'd like to deal only with one data class. Does someone has an idea?
    👍 1
    r
    r
    d
    • 4
    • 4
  • k

    Kshitij Patil

    12/08/2020, 6:22 AM
    How to pass data from a fragment hosting
    FragmentContainerView
    to its child fragments (which are part of the navigation graph used by FragmentContainerView)
    g
    m
    • 3
    • 6
  • e

    Erik

    12/08/2020, 6:35 AM
    Is there a way to contribute to the Android developer documentation pages? E.g. open issues or PRs? I think that this page could use a lot of small improvements because it misses certain things: https://developer.android.com/kotlin/flow/stateflow-and-sharedflow
    ➕ 1
    m
    • 2
    • 3
  • g

    gsala

    12/08/2020, 8:53 AM
    I see that neither Corbind nor FlowBinding expose View's state as
    StateFlow
    . Does it make sense to do so? Is there another library that is doing that?
    a
    • 2
    • 8
  • s

    Slackbot

    12/08/2020, 7:48 PM
    This message was deleted.
    a
    • 2
    • 1
  • n

    Nav Singh

    12/08/2020, 11:29 PM
    https://navczydev.medium.com/secure-sharedpreferences-android-9ba1e59f4250
    👍 6
    j
    • 2
    • 2
  • k

    Kshitij Patil

    12/09/2020, 1:38 PM
    What should we use for long running tasks that should survive process deaths or app restarts?
    CoroutineWorker
    with
    foregroundInfo
    isn't working in my case. I've opened up a websocket connection and want to listen for messages in background forever.
    g
    a
    +3
    • 6
    • 11
  • s

    Sagar Suri

    12/10/2020, 5:50 AM
    How can I avoid font override by system? For example: if a user set a custom font through settings, I don’t want my app to use that custom font but instead use sans-serif. I tried adding fontFamily to styles.xml but it didn’t help.
    :google: 5
    :stackoverflow: 6
    s
    c
    m
    • 4
    • 8
  • m

    Muhammad Aqib

    12/10/2020, 7:58 AM
    i need good tutorials of kotlin mvvm with okhttp without databinding. any help would be appreciated
    :google: 7
    s
    • 2
    • 9
  • o

    oday

    12/11/2020, 1:00 PM
    what does it mean when I get just 1 JSON object in my response and doing
    firstOrNull
    or
    find
    on it produces exception index out of bounds?
    v
    • 2
    • 7
  • a

    Arkangel

    12/11/2020, 5:22 PM
    hey guys how feasible is it to create a lottie splash screen. Setting up the theme is easy ..reference the drawable but getting the animation to start as a lottieview is what i’m thinking about
    m
    r
    • 3
    • 10
  • g

    gowthamgts

    12/12/2020, 6:03 AM
    are there any performance benefits of replacing livedata with flows? i’m assuming the difference is livedata is closely bound to android arch?
    r
    • 2
    • 2
  • c

    Chetan Tuteja

    12/12/2020, 7:08 AM
    Just looking for ideas. Have lot of data that needs to be inputted by the user for addition of something, so what is the best approach around it? One is to divide it into steps or parts, but how does one maintain the state of data on previous screens then before moving to next one, so that if a user traverses back, their data remains safe.
    r
    • 2
    • 6
  • h

    heisenberg

    12/12/2020, 9:42 AM
    Hi There, Can we used compose on production?
    🇳🇴 6
    :yes-black: 1
    c
    • 2
    • 1
  • c

    Chetan Tuteja

    12/12/2020, 11:32 AM
    Can StateFlows somehow be used to communicate between Fragments? Share data somehow via it? Also, is it recommended to do so?
    z
    • 2
    • 1
  • k

    Kshitij Patil

    12/12/2020, 3:35 PM
    I am looking for a tutorial showing how to handle multiple error types from retrofit. I'm currently using "Either" style types (one for Successs & Error each) but our APIs seems to have different json formats for different errors so I need a way to handle them in form of Sealed Class type. I found ZachSweers'
    moshi-sealed
    extension might help in this scenario but I'm afraid I won't be having any "type" parameter in the json which is required for
    moshi-sealed
    . Any tutorial hinting different approaches would also work.
    j
    • 2
    • 3
  • d

    Daniel

    12/13/2020, 12:20 PM
    Hi kotliers and a huge thanks in advance for reading my message! Question to following case: • Is it possible to eliminate
    reified
    in this mehod? I want to have a method which loads a value from the firebase database and the value needs to be properly typed when returned
    class OnlinePersistence { 
        suspend inline fun <reified T> loadValue(path: OnlinePersistencePath, default: T) =
                withContext(IO) {
                    suspendCancellableCoroutine<T> { continuation ->
                        FirebaseDatabase
                                .getInstance()
                                .getReference(path.rawPath)
                                .addListenerForSingleValueEvent(object : ValueEventListener {
                                    override fun onDataChange(snapshot: DataSnapshot) {
                                        if(continuation.isActive) {
                                            val value = snapshot.getValue<T>()
    
                                            if(value != null) {
                                                continuation.resume(value)
                                            } else {
                                                continuation.resume(default)
                                            }
                                        }
                                    }
    
                                    override fun onCancelled(error: DatabaseError) {
                                        if(continuation.isActive) {
                                            continuation.resume(default)
                                        }
                                    }
                                })
                    }
                }
    }
    All well and good now, but when I extract
    FirebaseDatabase.getInstance()
    into the constructor I cannot make it private like it should be. (Since the method is inline because of reified)
    r
    • 2
    • 3
  • s

    sbeve

    12/13/2020, 4:25 PM
    can I ask questions related to android studio issues here?
    :stackoverflow: 1
    j
    • 2
    • 2
Powered by Linen
Title
s

sbeve

12/13/2020, 4:25 PM
can I ask questions related to android studio issues here?
:stackoverflow: 1
j

Javier

12/13/2020, 5:45 PM
There is a channel for Android Studio
s

sbeve

12/14/2020, 9:42 AM
Thank you
View count: 1