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

    Saran Sankaran

    05/15/2020, 5:51 AM
    I assume you mean to say, you want to return after
    checkOrginization()
    method after completing the loop in success listener. Am’I getting it right?
    r
    s
    • 3
    • 10
  • a

    Ananiya

    05/15/2020, 7:37 AM
    why this code response body return null but the header is success i tried to change "@GET" annotation value from
    cases_by_country.php
    to
    /cases_by_country.php
    and even i change
    API_BASE_URL
    value from
    <https://coronavirus-monitor.p.rapidapi.com/coronavirus/>
    to
    <https://coronavirus-monitor.p.rapidapi.com/coronavirus/cases_by_coutry.php/>
    still it returns null why ? 🤔
    test_kt.kt
    r
    • 2
    • 1
  • r

    Remon Shehata

    05/15/2020, 11:22 AM
    I was using
    EditText
    and I had
    addTextChangedListener
    . I switched to
    TextInputEditText
    and I can't find the listener now!
    s
    • 2
    • 10
  • m

    myanmarking

    05/15/2020, 1:44 PM
    hello. Does any1 managed to get onActivityResult new API to work without starting the intent explicitly ? (i mean, just receive some result started not by the application)
    a
    • 2
    • 6
  • v

    Victor Maoya

    05/15/2020, 2:46 PM
    Do data structures and algorithms exist in Kotlin?
    :google: 6
    d
    s
    • 3
    • 3
  • l

    Leon johnson

    05/15/2020, 3:27 PM
    I'm trying to create an user and store into my firebase database using livedata observer. When I start the app up and run it the first time, the authentication works. But when I log the user out and try to create another user my app crashes. Any idea why this may be?
    g
    • 2
    • 2
  • s

    Samyak Jain

    05/16/2020, 9:46 AM
    Warning: <http://com.google.common.io|com.google.common.io>.ReaderInputStream: can't find referenced method 'java.nio.ByteBuffer clear()' in library class java.nio.ByteBuffer
    Warning: <http://com.google.common.io|com.google.common.io>.ReaderInputStream: can't find referenced method 'java.nio.CharBuffer position(int)' in library class java.nio.CharBuffer
    Warning: <http://com.google.common.io|com.google.common.io>.ReaderInputStream: can't find referenced method 'java.nio.CharBuffer limit(int)' in library class java.nio.CharBuffer
    Warning: <http://com.google.common.io|com.google.common.io>.ReaderInputStream: can't find referenced method 'java.nio.ByteBuffer flip()' in library class java.nio.ByteBuffer
    Warning: there were 16 unresolved references to library class members.
             You probably need to update the library versions.
             (<http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember>)
    :kotlin-compiler:proguard FAILED
    :kotlin-compiler:proguard (Thread[Task worker for ':' Thread 4,5,main]) completed. Took 17.994 secs.
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':kotlin-compiler:proguard'.
    > <http://java.io|java.io>.IOException: Please correct the above warnings first.
    
    * Try:
    Run with --debug option to get more log output. Run with --scan to get full insights.
    
    * Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':kotlin-compiler:proguard'.
    	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
    	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
    	at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
    	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
    Hi, I was trying to build source code using Gradle, I encountered the above error, can someone please guide me Why it is occurring? and What can be done?
    r
    • 2
    • 3
  • v

    vinny2020

    05/16/2020, 1:34 PM
    Hello guys, when I google Kotlin functions I get multiple results from the official docs which is great but not every reference has examples. What is the best way to view docs that have examples ?
    r
    • 2
    • 2
  • m

    Mark

    05/17/2020, 4:07 AM
    In Android Studio, is there a quick way to convert a function to a property (and all usages, of course): e.g.
    fun length(): Int
    to
    val length: Int
    ?
    j
    d
    +2
    • 5
    • 5
  • s

    Steve F

    05/17/2020, 4:48 AM
    Has anyone subscribed to the raywenderlich tutorials? Just wondering about their quality.
    r
    p
    • 3
    • 5
  • j

    Joan Colmenero

    05/17/2020, 10:53 AM
    Hello guys, I've a question, from my webservice it comes like a flag true or false, so on my adapter of my recyclerView I have to print one color or other depends of the flag, do I have to add this logic in the Viewholder? Also is there any other way to test this logic besides of UI? I do the mapper to my domain object, and it's tested.
    o
    • 2
    • 3
  • b

    Bidemi Muibudeen

    05/17/2020, 5:19 PM
    Hello everyone. I have a problem with Android Studio not syncing my gradle projects. What could be the reason and how can I help?
    r
    d
    • 3
    • 3
  • a

    Ananiya

    05/17/2020, 5:44 PM
    Hi I was trying to reassign the value of "@GET" annotation of retrofit on "setOnClickListner" to edit text value but it show me I cannot re assing annotation
    j
    • 2
    • 2
  • a

    Apex

    05/17/2020, 7:11 PM
    Does anyone have an example of onboarding flow using navigation component ? For example a intro slider using viewpager ? I have seen the conditional navigation docs but I don't understand how this would fit into what the docs recommend.
    r
    p
    • 3
    • 4
  • a

    Aurelian Ticușan

    05/18/2020, 3:47 PM
    Hello I have a question relating inner classes in Java I'm having troubles with. I have a utility class in which I hold various enum classes. There is no problem accessing them in Java classes, but when I try to access them in a Kotlin class, I get Unresolved reference: UtilityClass Utility class looks like this
    public final class UtilityClass {
    
        private UtilityClass() {
            // Utility class
        }
    
        public enum FirstEnum {
            FIRST_OPTION, SECOND_OPTION, THIRD_OPTION, NONE
        }
    }
    While the the data class in Kotlin is as follows
    data class KotlinClass(val option: UtilityClass.FirstEnum = UtilityClass.FirstEnum.NONE)
    Does anyone maybe know why I get "Unresolved reference: UtilityClass" trying to access the enum from my utility class? Both classes are in same package, so no imports required, I've tried moving either class in another package, but the issue persists I had no luck finding a solution for this, I can't find anything even remotely similar to this problem
    d
    c
    g
    • 4
    • 19
  • t

    TarunY

    05/19/2020, 9:17 AM
    Hello All, I am getting below error. any suggestions
    a
    • 2
    • 3
  • j

    Jolas

    05/19/2020, 11:31 AM
    I am Planning to develop apps for Android and IOS platforms. I came across Kotlin/Native technology and found a huge potential to have shared logic via a single Kotlin/native module. But from tech docs and samples I’ve seen only pinch of an iceberg . I am wondering if it’s stable enough for production. Because still while running builds I get a message “Kotlin/native is experimental” So do you recommend Kotlin/Native to be used for production Android/IOS apps? React with 👍🏾 for yes 👎🏾 for not yet
    ✊ 1
    👎 1
    g
    j
    o
    • 4
    • 17
  • n

    Nikolay Puliaev

    05/19/2020, 12:59 PM
    Hi, guys. Is there a way to merge two org.json.JSONObject using Kotlin? I’ve already googled it, but it was unsuccessfully. Maybe someone has an approach for that? Thanks in advance.
    d
    r
    s
    • 4
    • 5
  • d

    Denys

    05/19/2020, 2:06 PM
    Such a question - I need to send http requests, but I need to bind not to the activity lifecycle (in my case, viewModelScope), but to the life cycle of the app itself) I don’t really want to use the service for this. Why is GlobalScope bad in my case?
    ➕ 1
    m
    o
    o
    • 4
    • 5
  • c

    Colton Idle

    05/19/2020, 6:57 PM
    Does anyone know how I would be able to tell if my final apk is bundling kotlin reflect? I heard that if you add Moshi and moshi-kotlin it will have to pull in the kotlin reflect lib which in turn would make your apk ~2MB larger in size. I've used the apk analyzer and I wasn't able to find anything that large, but curious if anyone knows better than me.
    c
    • 2
    • 5
  • s

    Sam

    05/20/2020, 4:13 AM
    Anyone have any solution to resolve concurrency issue on ArrayList? Firebase crash log:
    Fatal Exception: java.util.ConcurrentModificationException
           at java.util.ArrayList$Itr.next(ArrayList.java:860)
    My code:
    val dataConversation = ArrayList<Conversation>() // global
    
    // in background ( I have use Epoxy - Airbnb )
    val cloneListConcurrency = arrayListOf<Conversation>().apply { addAll(dataConversation) }
            with(cloneListConcurrency.iterator()) {
                forEach {
    // do something to display 
    }}
    
    // in background
    fun deleteConversation(conversationId: String?) {
            for (index in 0 until dataConversation.size) {
                val item = dataConversation[index]
                if (item.id == conversationId) {
                    dataConversation.removeAt(index)
                    break
                }
            }
        }
    Many Thanks.
    a
    g
    s
    • 4
    • 16
  • m

    Manuel Lorenzo

    05/20/2020, 11:14 AM
    anybody has other suggestions or tips for this? Thanks in advance!
    h
    • 2
    • 1
  • s

    sanket

    05/20/2020, 11:59 AM
    Hello android, I am trying to set up network and app logs in my app. Can any one guide me to the right way of doing this #netlogs #logging
    :stackoverflow: 4
    h
    t
    • 3
    • 4
  • t

    Tim

    05/20/2020, 1:42 PM
    hey everyone, i found a great gradle plugin that generates an HTML file for all the open source licenses in the project. however a lot of years seem to be missing and are replaced instead with “20xx” instead of 2019 or 2020. am i supposed to leave that as is? or replace it with 2020?
    z
    r
    • 3
    • 5
  • k

    Kents

    05/20/2020, 2:43 PM
    I am attempting to add a DrawerListener to my DrawerLayout in Activity onCreate:
    binding.quickviewDrawer.addDrawerListener(listener)
    but the listener seems to be getting nulled out when I add a breakpoint in DrawerLayout.java Anyone have an idea why my listener is not persisting?
    • 1
    • 2
  • h

    henrikhorbovyi

    05/20/2020, 9:52 PM
    Hey kotliners, 🙂 Does anybody have some opinion about KTX:
    isVisible
    ,
    isInvisible
    ,
    isGone
    extensions? I mean, first time I implemented KTX in my project I expected something like:
    gone()
    ,
    visible()
    ,
    invisible()
    h
    c
    s
    • 4
    • 13
  • i

    iex

    05/21/2020, 8:37 AM
    Not the best channel to ask this but I'll smuggle very quickly a non-Kotlin question, since people here are very responsive 😉 Does anyone know how to differentiate between internal/alpha/beta releases in Google Play? They seem to have the same URL? And no alpha/beta text anywhere?
    d
    j
    • 3
    • 3
  • r

    Remon Shehata

    05/21/2020, 5:55 PM
    how can I import data from excel to POJO in my app?
    :google: 2
    :stackoverflow: 3
    m
    • 2
    • 5
  • v

    vinny2020

    05/21/2020, 7:20 PM
    anyone know of any frameworks/APIs/libs for incorporating the ability to record and stream live video from an android app ?
    h
    • 2
    • 2
  • o

    OG

    05/21/2020, 10:03 PM
    Hello everyone 👋, I've done a bit of R&D but was curious if anyone here has additional recommendations on good libraries available to build a feature similar to Instagram stories. The ability to record a story video/image, voice/sound over from a music track, add stickers, etc plus view stories. Appreciate any help. Thanks! 👍
    h
    • 2
    • 1
Powered by Linen
Title
o

OG

05/21/2020, 10:03 PM
Hello everyone 👋, I've done a bit of R&D but was curious if anyone here has additional recommendations on good libraries available to build a feature similar to Instagram stories. The ability to record a story video/image, voice/sound over from a music track, add stickers, etc plus view stories. Appreciate any help. Thanks! 👍
h

Harun

05/22/2020, 8:02 AM
You can have a look at this libraries : https://github.com/OMARIHAMZA/StoryView https://github.com/shts/StoriesProgressView https://github.com/bxute/StoryView
View count: 2