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

    voddan

    10/31/2019, 8:58 PM
    Hi, everyone! I need to create a UI wiget that will hold an observable reference to a small portion of my state and display it with a custom layout. This wiget may be used inside an Activity or a ResycleView. In modern Android, can I do it? I've tried a view, but it doesn't support lifecycle on its own. I've tried a fragment, but it seems to be unusable from a ResycleView
    p
    c
    s
    • 4
    • 9
  • f

    Freedom

    11/01/2019, 9:48 PM
    Hello guys please how can I pass a nested request using retrofit
    :google: 10
    :stackoverflow: 4
    f
    l
    • 3
    • 4
  • b

    Bacho Kurtanidze

    11/02/2019, 12:51 PM
    like say for some reason I'm returning LiveData<List<String>> from my data source and I want to emit different values depend in which state my data is how would I handle it from view's and viewModel's part?
    r
    • 2
    • 3
  • j

    Jérôme Gully

    11/02/2019, 6:24 PM
    Hi, I currently follow the new course "Android Kotlin Fundamentals", I'm at the chapter 05.2: LiveData and LiveData observers, and i have a question about this chunk of code:
    score.value = (score.value)?.minus(1)
    why the parentheses ? isn't the exact same thing that:
    score.value = score.value?.minus(1)
    (score isn't nullable)
    l
    • 2
    • 7
  • m

    mhamade

    11/03/2019, 3:24 AM
    Is it better to do this:
    context.getSystemService(VIBRATOR_SERVICE) as Vibrator
    or
    context.getSystemService(VIBRATOR_SERVICE) as? Vibrator
    t
    l
    l
    • 4
    • 6
  • d

    Duchynko

    11/03/2019, 12:13 PM
    Morning (from Denmark) guys. Quick question regarding "best practices". Would you add your business logic to an activity rather than a fragment? I'm talking specifically about making an HTTP request to fetch data, which are displayed in only 1 fragment. (List of students). Other two fragments don't use these data, but will perform different HTTP requests in the future. Therefore, in my opinion it would make sense to separate this logic between fragments instead of keeping everything in the MainActivity. I'll be happy to hear your opinions. Cheers.
    x
    a
    +2
    • 5
    • 4
  • f

    Freedom

    11/03/2019, 8:25 PM
    Hello guy i have this issues when add a class to my room model I can't insert data to that class for example. @Entity Data class AuthResponse( val token:String val refreshtoken:String val user:User ) data class User( firstname:String lastname: String )
    :stackoverflow: 3
    :google: 10
    l
    • 2
    • 1
  • n

    Nikola Milovic

    11/04/2019, 8:09 AM
    Hey guys, I am having trouble with Dagger2 DI my fragments. I'm trying to use the googles dagger2 mvvm architecture as a reference but it's not working. The solutions I found online are deprecated or i am uncertain how to use them. I am still learning DI and dagger so it's not perfect Here's the error and the fragment that's causing it: https://hastebin.com/ipudoharef.m Here's my DI: https://github.com/Nikola-Milovic/QuoteAppMvvm/tree/master/app/src/main/java/com/example/quoteappmvvm/di
    w
    c
    r
    • 4
    • 26
  • f

    fengdai

    11/04/2019, 12:39 PM
    Hey guys, I need your help. The application which I’m working on contains many RecyclerViews, and each of the RecyclerViews can contain many types of items, 10+ on average. I joined my current team earlier on, and I felt very painful to maintain the huge bunch of viewtypes and binding logic during this time. So I wrote a library recently, trying to make this kind of situation a little bit easier. I hope you guys can help me review this library and give me some suggestions about API design, naming and etc. Thanks. And this is my library: https://github.com/fengdai/registry
    c
    c
    • 3
    • 5
  • h

    Hitanshu Dhawan

    11/04/2019, 8:07 PM
    Article to know the internals of
    LiveData
    and how it works. 👏 https://medium.com/androidiots/how-i-made-my-own-livedata-1faf4a45520
    👏 2
    a
    • 2
    • 3
  • v

    voben

    11/05/2019, 6:31 PM
    What’s the difference between creating a property with a getter function vs one without. Are these 2 actually the same thing?
    val myLiveData: LiveData<String> = _backingLiveData
    
    val myLiveData2: LiveData<String> 
          get() = _backingLiveData
    c
    j
    +2
    • 5
    • 5
  • f

    FranGSierra

    11/06/2019, 11:25 AM
    Fast Question. How I can prevent proguard to obfuscate an object name? Im trying it with
    -keep class qualifiedClassname
    but it never works
    m
    • 2
    • 1
  • a

    Abhishek Bansal

    11/06/2019, 12:02 PM
    Hey Guys, I am trying to write
    Espresso
    unit tests on Android. Does this gradle flag even work?
    testOptions {
            animationsDisabled = true
        }
    d
    y
    • 3
    • 3
  • a

    Anastasia Finogenova

    11/06/2019, 3:14 PM
    More of a better practice question, I have a fragment with a viewpager inside which items are also fragments. Depending on the even in a child fragment inside a viewpager I need to notify the parent fragment (the one that contains viewpager). I see a couple of ways like passing a function to the fragment constructor , using an interface and casting the context to it inside the child fragment. What other (possibly better ways) do you all see for this use case?
    f
    • 2
    • 12
  • t

    Tim

    11/06/2019, 4:34 PM
    how do we show progress indicators in 2019? like the spinning circle
    a
    t
    +3
    • 6
    • 8
  • p

    pshegger

    11/06/2019, 5:17 PM
    Hi everyone, I have just released a new library for generating RecyclerView adapters using annotations. If you hate writing your adapter over and over just have a look at it and tell me what's your opinion: https://github.com/PsHegger/recycleradapter-generator
    👍 3
    f
    c
    • 3
    • 6
  • j

    Jonny

    11/06/2019, 10:29 PM
    How can I set a function to be used in a custom control? I can expose and bind to properties like strings, ints, etc, but how can I do the same for a function?
    a
    a
    • 3
    • 88
  • a

    Almas Shagdarov

    11/07/2019, 11:03 AM
    help me please how correctly i should get ontextchanged text to viewmodel to insert to Room DB? by not destroying MVVM architecture
    w
    a
    • 3
    • 8
  • j

    jmfayard

    11/07/2019, 1:24 PM
    Compiling an Android app fails with Java11. Only Java8 is supported, right?
    p
    • 2
    • 2
  • x

    XQDD

    11/07/2019, 3:24 PM
    Can android do something like this in the global text selection scope?
    :google: 3
    :stackoverflow: 3
    c
    e
    • 3
    • 9
  • t

    tseisel

    11/07/2019, 7:22 PM
    Am I right in thinking that Kotlin already supports all new language features introduced in Java 9, 10, 11 and 12, and that supporting those newer Java versions in Android does not add anything for Kotlin Developers ?
    a
    j
    +3
    • 6
    • 24
  • l

    louiscad

    11/08/2019, 8:50 AM
    message has been deleted
    1️⃣ 3
    👍 1
    k
    i
    p
    • 4
    • 11
  • g

    ghosalmartin

    11/08/2019, 1:38 PM
    Anyone have a Kotlin function that can take any object no matter how many nested objects it has and turn it into a Retrofit Multipart body?
    c
    • 2
    • 4
  • a

    Almas Shagdarov

    11/08/2019, 2:41 PM
    Hi everyone i cant add viewmodel class func execution to @ navigate up button on app bar plz tell how can i do that?
    w
    • 2
    • 1
  • r

    RoqueRueda

    11/08/2019, 7:21 PM
    Hi, quick question it's possible to use by lazy with a suspend function
    g
    s
    • 3
    • 2
  • a

    Almas Shagdarov

    11/09/2019, 7:09 PM
    And one more quistion in edit mode(copy/cut/selection) when im selecting text bottom toolbar hides how can i fix it?
    :stackoverflow: 1
    b
    • 2
    • 2
  • a

    Abhishek Bansal

    11/10/2019, 9:29 AM
    Setting up UI unit testing in Android is pain. I recently had this experience and wrote this article which tries to consolidate all pain points/gotchas at single place. https://link.medium.com/VtccFcwWu1
    r
    • 2
    • 4
  • b

    Bin

    11/10/2019, 4:26 PM
    tried LiveData+Coroutine but the issue is when click a button need to call the Api ,first time working fine, second time request is not sending. Transformation is required here?
    n
    r
    g
    • 4
    • 9
  • a

    Almas Shagdarov

    11/10/2019, 4:53 PM
    I have troubles with data binding when i'm using kotlin library 1.3.21 < higher
    t
    • 2
    • 1
  • a

    Almas Shagdarov

    11/11/2019, 12:50 PM
    i googled tried every version but just making logic messy
    g
    • 2
    • 4
Powered by Linen
Title
a

Almas Shagdarov

11/11/2019, 12:50 PM
i googled tried every version but just making logic messy
g

gergo

11/11/2019, 1:16 PM
most common i saw is a safeguard flag, before you set the text in the onTextChange you check the flag and set it, afterwards you reset it
however the question is not kotlin related so it's not really the place to post it to
❤️ 1
a

Almas Shagdarov

11/11/2019, 1:17 PM
ok
sorry
View count: 1