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

    Kshitij Patil

    12/13/2020, 4:57 PM
    My app is getting installed with the previous data (shared-preferences & files) even after clearing data and uninstalling the app from device and reinstalling it via studio. Is this a bug or am I missing something? I'm using
    datastore-preferences
    version
    1.0.0-alpha05
    and AS 4.2 Canary 16
    k
    • 2
    • 5
  • s

    sbeve

    12/13/2020, 5:05 PM
    @kenkyee well they basically never reply I posted two questions more than a week ago and neither of em got any attention. They weren't even that tricky and I figured them out soon.
    k
    • 2
    • 2
  • p

    Peter Farlow

    12/14/2020, 3:11 PM
    I know that databinding includes the viewbinding, but is it possible to enable databinding and viewbinding in your project at the same time?
    :stackoverflow: 1
    o
    a
    • 3
    • 3
  • t

    tylerwilson

    12/14/2020, 11:48 PM
    Just updated to Arctic Fox Canary 3 (I am using Compose, so have to use this one), which updated AGP to 7.0.0 alpha03. It now fails when trying to build my KMP module with:
    Configuration with name ‘testApi’ not found.
    Anybody else see this?
    ➕ 7
    i
    r
    +2
    • 5
    • 13
  • d

    diego-gomez-olvera

    12/15/2020, 12:30 PM
    did anyone see a Lint error
    Missing Parcelable CREATOR field
    after migrating to `kotlin-parcelize`(Kotlin 1.4.21) ? I see that the field is generated:
    public static final android.os.Parcelable.Creator CREATOR = new Action.Creator();
    z
    • 2
    • 3
  • a

    andodeki

    12/15/2020, 6:00 PM
    I get the above error when I try to run the application on a device even after creating the navigation resource and building the project it seems the navigation classes aren't created. what might be the issue
    r
    • 2
    • 1
  • p

    paulex

    12/16/2020, 12:29 PM
    Looking for a clean way to do it without passing context to the viewModel
    s
    • 2
    • 8
  • a

    Alf_

    12/16/2020, 1:30 PM
    Hello guys, I have a slide button like amazon app and I'm trying to transform the text inside to white when the trail layout is over it and turn it black when I swipe out back. Do you know guys if this is possible? I tried using another text overlapped in the middle but its moving with the trail and not keeping in the middle of the button.
    :stackoverflow: 1
    :google: 1
    m
    h
    • 3
    • 3
  • r

    Rohit

    12/16/2020, 1:44 PM
    Hi Any one knows about Intent Redirection vulnerability. I tried to publish my app but Play console team rejected it saying "Your app(s) are vulnerable to Intent Redirection". Couldn't understand as no further details are given. Please help.
    :google: 2
    :stackoverflow: 1
    s
    • 2
    • 1
  • e

    Elnur Jeksenov

    12/16/2020, 2:17 PM
    Hi guys! I have a pack with ten thousands icons in svg format(pack’s all size: 10mb). So I have to import this to my project. Is there any way to do this like creating a library and use this or anything else?
    :google: 1
    :stackoverflow: 1
    r
    • 2
    • 1
  • n

    Nana Vong

    12/17/2020, 5:45 AM
    inline fun <T : Any> fromServerResp(json: String): T {
        val baseResp: BaseResp<T> =
            Gson().fromJson(json, object : TypeToken<BaseResp<T>>() {}.type)
      ...
      return baseResp.data!!
    Why the inline function generates a new class when it is called across modules, but it cannot be called in the same module?
    p
    k
    • 3
    • 5
  • j

    Jaime Guerrero

    12/17/2020, 6:40 AM
    Hi everyone!! As some of you know, some months ago I launched my pet project related to covid. I focused on displaying statistics using graphs and an Offline-first approach using SSOT. And Flow, MVVM, Kotlin DSL, Github Actions, Room with hard queries, etc. The database is huge, from 2020/01/23 I have some tables with more than 1M rows. Now, I have almost ✅ 400 tests ✅ mixing some libraries like Mockito, Mockk, FlowTest, etc. It would be amazing if you want to contribute adding more and more tests or adding Compose, StateFlow, Theme, etc. Thanks! https://github.com/jaimegc/Covid19Tracker
    ❤️ 2
    :kotlin-intensifies: 1
    p
    • 2
    • 2
  • m

    Mark

    12/18/2020, 6:46 AM
    Are there any tools to help inform when there is an alternative
    -ktx
    dependency that would be better to use? I only recently discovered
    firebase-analytics-ktx
    and
    firebase-crashlytics-ktx
    (as well as the whole firebase BoM thing)
    👀 1
    g
    a
    • 3
    • 2
  • d

    Drasko Saric

    12/18/2020, 11:14 AM
    Hi, guys, I have a webView in the fragment and when I open some url that belongs to, for example, twitter, the page is shown but I can’t open any external link that are provided in tweets. Those external links actually all have set
    target="_blank"
    and I have appropriate js script injected when
    onPageFinished
    is called:
    webView.webViewClient = object : WebViewClient() {
    
        override fun onPageFinished(view: WebView, url: String?) {
            Timber.d("onPageFinished: url = $url")
            view.loadUrl("javascript: var allLinks = document.getElementsByTagName('a'); if (allLinks) {var i;for (i=0; i<allLinks.length; i++) {var link = allLinks[i]; var target = link.getAttribute('target'); if (target && target == '_blank') { link.removeAttribute('target');}}}")
        }
    This handling works for websites that provide their content immediately and this function is called when actual page loading is finished, but loading tweets is done asynchronously long after that. Does anyone have any idea how can I handle those newly injected urls in the page and change their
    target
    attributes ?
    :google: 3
    :stackoverflow: 3
    k
    r
    g
    • 4
    • 7
  • a

    andodeki

    12/18/2020, 8:03 PM
    what might be the issue here
    e
    g
    • 3
    • 32
  • u

    Umar Ata

    12/19/2020, 5:29 PM
    Hi there, I used synthetic binding in my project It is everywhere like Activities, Fragments, RVAdapters Now it is deprecated and I have no clue how to convert it to view binding For now I only understand that I have to change it in every class manually Is there any automatic solution or tool available?
    k
    s
    t
    • 4
    • 5
  • a

    andym

    12/21/2020, 3:10 AM
    Should I use Kotlin 1.4.21 in my project with Android Studio 4.1.1, Gradle 6.5 and the Android Gradle plugin 4.1.1? My builds have lines like the following:
    w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    /Users/snip/.gradle/caches/transforms-2/files-2.1/bac97eb1605b4833d56979273f673da2/jetified-kotlin-stdlib-jdk7-1.4.21.jar (version 1.4)
    /Users/snip/.gradle/caches/transforms-2/files-2.1/924035e17cc9c5fe36bf2b18b22aa2fb/jetified-kotlin-reflect-1.3.50.jar (version 1.3)
    /Users/snip/.gradle/caches/transforms-2/files-2.1/0e4359b74f91d4fdd98cefa0d215fe0c/jetified-kotlin-stdlib-1.4.21.jar (version 1.4)
    /Users/snip/.gradle/caches/transforms-2/files-2.1/84264f1288926d1cb0c7b30f75e01627/jetified-kotlin-stdlib-common-1.4.21.jar (version 1.4)
    w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
    k
    f
    j
    • 4
    • 6
  • u

    UnAn

    12/21/2020, 9:19 AM
    I have to do an app and i "need" to use SQL database to store data about the products but I wanted to implement a chat in my app and was considering firebase but is it something that i should do? Or just do everything using SQL or firebase ecosystem?
    :google: 1
    :stackoverflow: 1
    m
    • 2
    • 2
  • a

    andodeki

    12/21/2020, 10:26 AM
    What the issue here guys
    :google: 2
    d
    d
    p
    • 4
    • 10
  • m

    Mark

    12/22/2020, 3:16 AM
    Curious why there is no coroutines-friendly alternative to
    SupportSQLiteOpenHelper
    . So, suspend funs for
    getReadableDatabase()
    etc, and a callback with
    suspend fun onUpgrade()
    etc.
    a
    d
    • 3
    • 9
  • s

    Slackbot

    12/22/2020, 4:27 PM
    This message was deleted.
    s
    n
    • 3
    • 2
  • c

    Chetan Sachdeva

    12/22/2020, 6:19 PM
    Does anyone know a fix for this?
    class ClassA<B: ClassB<*>> {
    
    }
    
    class ClassB<A: ClassA<*>> {
    
    }
    I’m getting an error:
    This type parameter violates the Finite Bound Restriction
    . What am I doing wrong here?
    v
    • 2
    • 4
  • s

    Sergio C.

    12/22/2020, 6:32 PM
    why is kotlin not creating a default constructor for the fragments? How do I add an empty default constructor? Some devices are crashing because there's no default constructor in the fragment. 😐
    s
    c
    • 3
    • 14
  • s

    Slackbot

    12/23/2020, 10:55 AM
    This message was deleted.
    👮‍♀️ 1
    👮‍♂️ 2
    ⛔ 3
    🚔 1
    🤦‍♂️ 6
    🚫 4
    👎 15
    :no_red: 5
    🤨 2
    🚓 3
    d
    g
    o
    • 4
    • 3
  • v

    Vikas Singh

    12/23/2020, 8:23 PM
    Hi, I am using a variable inside viewmodel observer and it's value is not updated even after updating it in instance of childfragment (viewpager), ex: when i move to next tab varible inside viewmodel still holds the previous tab name
    r
    • 2
    • 3
  • j

    Jason

    12/24/2020, 9:17 AM
    Hi , I want to force ANR trigger in my app. Base on ANR trigger concept https://developer.android.com/topic/performance/vitals/anr I use below code to reproduce
    viewModelScope.launch(Dispatchers.Main) {
                while (true) {}
            }
    OR
    viewModelScope.launch(Dispatchers.Main) {
       delay(TimeUnit.SECONDS.toMillis(5))
    }
    But UI is stuck but ANR does not occur … Any help?
    k
    a
    • 3
    • 4
  • k

    Kshitij Patil

    12/24/2020, 9:44 AM
    Hi, I've a doubt regarding Store4 ? May I ask it here?
    h
    • 2
    • 2
  • a

    Alexander Khyzhun

    12/24/2020, 11:55 AM
    👋 Hi everyone I’m happy to share with you the post I just released. It is designed for juniors, but any support is welcome ✌️
    ❌ 1
    👎 1
    l
    • 2
    • 2
  • p

    paulex

    12/24/2020, 6:33 PM
    How would you implement a search using Paging3 I’ve tried resubscribing to the paging source , but the result isn’t very good
    :google: 3
    d
    • 2
    • 2
  • s

    san

    12/25/2020, 8:40 AM
    could any one tell how to implement file download with progress in retrofit like whatsapp file download progress
    :google: 6
    :stackoverflow: 2
    t
    f
    z
    • 4
    • 4
Powered by Linen
Title
s

san

12/25/2020, 8:40 AM
could any one tell how to implement file download with progress in retrofit like whatsapp file download progress
:google: 6
:stackoverflow: 2
t

treatmaster

12/25/2020, 11:08 AM
I have one but with ktor here https://gist.github.com/stevepham/b05c634e12effca76ae0e9b86d9247a8. it could be the same with retrofit
s

san

12/25/2020, 11:10 AM
ok i will try,thanks👍
f

FunkyMuse

12/26/2020, 10:16 AM
https://github.com/FunkyMuse/KAHelpers/blob/master/retrofit/src/main/java/com/crazylegend/retrofit/progressInterceptor/ProgressResponseBody.kt And add this interceptor https://github.com/FunkyMuse/KAHelpers/blob/master/retrofit/src/main/java/com/crazylegend/retrofit/progressInterceptor/OnProgressDownloadInterceptor.kt
z

Zac Sweers

01/02/2021, 9:57 AM
this has nothing to do with kotlin
View count: 2