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

    Виталий Перятин

    07/01/2019, 6:30 AM
    How to solve this problem? Android Studio doesn't see Kotlin specific code
    g
    • 2
    • 2
  • m

    Matej Drobnič

    07/01/2019, 12:03 PM
    Is there a way to profile (https://intellij-support.jetbrains.com/hc/en-us/articles/207241235-Reporting-performance-problems#capture_slow_startup_2019_2) Android Studio on Windows? Need for kotlin-related issue (kts autocomplete). For me, "Start async profiler" option is grayed out, pressing "Enable async profiler" throws
    Can't attach profiler agent dynamically. Please try to enable it persistent
    . Adding provided flags to vmoptions causes studio to just flat out not start.
    a
    • 2
    • 1
  • v

    voben

    07/01/2019, 2:30 PM
    Android studio(v 3.4.1) refuses to recognize the
    Livedata.observe()
    extension, and whenever I do a ‘go to declaration’, it keeps taking me to the java LiveData observe function. How do I get it to recognize the kotlin extension and highlight it in yellow? Already tried invalidate cache and restart
    r
    l
    • 3
    • 4
  • d

    Drew Hamilton

    07/01/2019, 7:41 PM
    implementation project(':mysdk')
    • 1
    • 1
  • v

    voben

    07/01/2019, 7:44 PM
    .kts notation:
    implementation(project(":mysdk"))
    The advantage of using kts is you get autocomplete, so you should see it autocomplete working as you type
    p
    • 2
    • 2
  • t

    TheDukerChip

    07/02/2019, 1:54 PM
    What should I do to receive SIP calls even when app is in background, exits or restarts? Currently we're running a foreground service with sticky notification to keep connected with our sip server. This solution isn't completely working Please help me to achieve this, Thanks in advance! Question asked in StackOverflow https://stackoverflow.com/questions/56854350/unable-to-receive-sip-calls-when-app-is-killed
    :stackoverflow: 4
    :google: 4
    r
    • 2
    • 2
  • j

    Joan Colmenero

    07/02/2019, 3:01 PM
    What's the difference between :
    interface BasePresenter<in T : BaseView> {
        fun attachView(view: T)
    }
    And
    interface BasePresenter<T> {
        fun attachView(view: T)
    a
    • 2
    • 2
  • k

    kevin.cianfarini

    07/03/2019, 12:02 AM
    Does anyone have any tips of wrapping a
    LiveData
    in a
    Flow
    or using flow in instead of Livedata?
    r
    g
    +3
    • 6
    • 25
  • g

    goku

    07/03/2019, 11:50 PM
    I’m curios why this hasn’t been reported/starred by more people. Every time I start emulator at work, and come home to continue the work, emulator loses Wifi connection and I have to restart the emulator. Does it happen to you at all? https://issuetracker.google.com/issues/132825448
    w
    • 2
    • 5
  • r

    rkeazor

    07/04/2019, 1:22 AM
    Just restart the emulator , it saves a snapshot lol
    g
    • 2
    • 1
  • t

    Tuan Kiet

    07/04/2019, 5:56 AM
    is there any Interceptor equivalent in Ktor like OkHttp?
    t
    d
    t
    • 4
    • 8
  • j

    Joan Colmenero

    07/04/2019, 1:44 PM
    Let me know if someone that is used to unit testing can help me out I wrote it down on #mockk, but couldn't get an answer, it's about how to test an MVP app using usecase repository and presenter, or at least which methods do I have to test, thanks 😄
    u
    l
    • 3
    • 7
  • l

    lawlorslaw

    07/04/2019, 3:37 PM
    what is the best way to override a getter in data class? i came across this post https://code.luasoftware.com/tutorials/kotlin/override-getter-for-data-class/
    m
    a
    r
    • 4
    • 4
  • l

    Lukas Anda

    07/04/2019, 9:37 PM
    Hey guys, does anyone know why code in my subscribe() is not called ? Also note that this code is executed inside service that is independent of app
    RxJava.kt
    p
    • 2
    • 6
  • u

    ubu

    07/05/2019, 11:31 AM
    Hi there. I have trouble updating Kotlin from
    1.2.71
    to
    1.3.10
    in Android Studio
    3.4.
    I get unresolved references for all
    RxJava
    dependencies. Then I get a popup message in AndroidStudio saying: '../StudioProjects/FuraReloaded/build.gradle': 34: only buildscript {} and other plugins {} script blocks are allowed before plugins {} blocks, no other statements are allowed. Here's my
    build.gradle
    file: https://gist.github.com/uburoiubu/9378f28fd77d46ed27b12ff34ed3a8ff Any help will be appreciated.
    j
    • 2
    • 1
  • j

    Jan

    07/05/2019, 12:09 PM
    hi guys how do i keep proguard/r8 from stripping annotation information? @Deprecated(message = "Reduce release string generation: use logi{ message }", replaceWith = ReplaceWith("logi{ message }", "net.kibotu.logger.Logger.logi"))
    r
    • 2
    • 3
  • l

    lenqnr

    07/05/2019, 12:13 PM
    I have a
    DialogFragment
    that calls a `ViewModel`'s method, and the method calls a suspending method via
    viewModelScope.launch
    . The problem is, when I click OK button on the dialog, I get
    kotlinx.coroutines.JobCancellationException: Job was cancelled
    error message and the suspending method doesn't work. How can I overcome this problem? I moved the method to my
    MainViewModel
    and accessed it with
    sharedViewModel
    , but still the same
    JobCancellationException
    occured.
    r
    • 2
    • 10
  • a

    alec

    07/05/2019, 2:09 PM
    use the
    execute
    methods instead of
    asObservable
    b
    j
    • 3
    • 8
  • i

    itnoles

    07/06/2019, 2:16 AM
    "For example, repeated copying between new collection instances can impact GC performance, and calling a method that accepts non-null types adds a method call for the null check (though you can disable runtime null checks in the compiler with -Xno-param-assertions)." so it is okay to use it on Android's app build.gradle?
    i
    • 2
    • 1
  • d

    Darrinps

    07/06/2019, 8:18 PM
    Does anyone know how to use the BleGattCoroutines notifications? I can't find any example of it. Normally you'll have a BluetoothGattCallback to intercept a notification change and can read the data there. Don't see how this is done with BleGattCoroutines though.
    l
    • 2
    • 6
  • t

    ti4n

    07/07/2019, 4:01 AM
    Does anyone use room with coroutines and paging library? If I make the dao's function suspend, it's return type can't be DataSource.Factory
    l
    • 2
    • 1
  • j

    Joan Colmenero

    07/07/2019, 9:23 AM
    Just posted a question about room in stackoverflow, it's about an M:N relationship, if you know or have worked with it, please ping me, I'm seeing that I'm almost done but I need my last clarification. Thanks!
    d
    • 2
    • 11
  • s

    Slackbot

    07/08/2019, 7:07 AM
    This message was deleted.
    c
    j
    g
    • 4
    • 3
  • p

    paste

    07/08/2019, 11:51 AM
    with Kotlin DSL build scripts, is there a way to define the dependency version extras separately in top level build.gradle.kts while still keeping the version update available warnings on the module level build.gradle.kts? I noticed i don't get the outdated dependency version warning anymore which worked before converting from Groovy to Kotlin DSL.
    // root build.gradle.kts
    buildscript {
      extra.set("androidxMaterialVersion", "1.1.0-alpha06")
      ...
    }
    
    // module/app build.gradle.kts
    dependencies {
     implementation("com.google.android.material:material:${rootProject.extra.get("androidxMaterialVersion")}")
    }
    this above is the implementation i'm using btw. the module implementation does not give a (Android Studio) warning saying there is a new version available, which works if it's Groovy
    i
    p
    • 3
    • 4
  • a

    Animesh

    07/08/2019, 1:18 PM
    Can we send message from our App to Whats App and vice versa ? Does Whats app expose any such API
    :google: 2
    f
    g
    • 3
    • 3
  • a

    android.zeeshan

    07/08/2019, 9:54 PM
    Should I use doAsync or Coroutines with Room ? Which one is better and why ? I have used doAsync with Room that works fine for so far.
    g
    t
    • 3
    • 8
  • i

    ivano

    07/09/2019, 10:15 AM
    Will jetpack compose become the kotlin web frontend solution, as is aiming ios with swiftUi and swiftWebUi?
    🔮 2
    t
    g
    a
    • 4
    • 37
  • a

    android.zeeshan

    07/09/2019, 5:18 PM
    I am missing logm template in Kotlin. Basically there is no template for logs like in Java. How can I create these ?
    a
    • 2
    • 3
  • j

    Jonny

    07/09/2019, 6:05 PM
    Hi everyone. I'm pretty much a beginner. Right now I'm moving from intents to using NavigationController. My issue is that when I'm adding arguments, there is no argument for Double.
    :google: 2
    j
    • 2
    • 19
  • s

    scottiedog45

    07/10/2019, 1:17 AM
    Is this the most elegant way to “go back two screens (i.e. two fragments)” if I have a single activity app using the navigation architecture component? Seems extremely strange, but works perfectly (calling this method twice…).
    fragmentManager?.popBackStack()
    fragmentManager?.popBackStack()
    (edited)
    a
    • 2
    • 6
Powered by Linen
Title
s

scottiedog45

07/10/2019, 1:17 AM
Is this the most elegant way to “go back two screens (i.e. two fragments)” if I have a single activity app using the navigation architecture component? Seems extremely strange, but works perfectly (calling this method twice…).
fragmentManager?.popBackStack()
fragmentManager?.popBackStack()
(edited)
a

Adam Powell

07/10/2019, 1:19 AM
what's the use case for, "go back two screens?" It sounds like you're trying to do something specific but two backs is incidentally correct in that specific circumstance
generally you would navigate to another particular destination, or pop to a certain tag marker
s

scottiedog45

07/10/2019, 1:23 AM
use case: Screen A is a form, Screen B is a subset of options for the one of the fields, and Screen C is a set of options for one of the options in Screen B. Choosing an option on Screen C should “go back” to screen A, skipping Screen B.
a

Adam Powell

07/10/2019, 1:24 AM
sounds like you're looking for https://developer.android.com/reference/androidx/navigation/NavController.html#popBackStack(int,%20boolean)
to pop to the specific destination of screen A
s

scottiedog45

07/10/2019, 1:28 AM
This is exactly what I needed. Thanks 😃
👍 6
View count: 1