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

    bringoff

    11/28/2017, 6:51 AM
    Welp, I’ve just tried to update support library to 27.0.1 version from 26.1.0 and got a whole bunch of nullability errors because a lot of methods like
    getActivity
    in Fragment got
    @Nullable
    annotation. But what should I do now in following situations? For example, I build DialogFragment. I need a context in
    onCreateDialog
    method. To do something like this:
    return MaterialDialog.Builder(context)
                    .title(R.string.invitation_to_team_dialog_title)
                    .content(buildDescriptionText())
                    .build()
    onCreateDialog
    method must return NonNull Dialog instance so I can’t use
    context?.let
    call. And I really doubt context may be null on this stage (as well as activity in Fragment’s
    onCreateView
    method, I suppose?). So I forced to use ugly
    !!
    call. @jw as I know from your twitter these annotations were your endeavor. So, from your opinion, what should be an intended workaround in this situation? I don’t really like double exclamation point. It looks like very Java-ish way to care about nullability, sort of “I don’t care, whatever”
    ➕ 1
    g
    p
    • 3
    • 8
  • f

    Fré Dumazy

    11/28/2017, 8:08 AM
    I'm looking at some dependency injection frameworks for my next project. at the moment i would prefer Koin over Dagger because of its simplicity. Any thoughts on that, pitfalls I have to be careful with, other frameworks I should have a look at, etc?
    g
    b
    +4
    • 7
    • 9
  • f

    fjanicki

    11/28/2017, 10:24 PM
    Anyone knows if there is a PMD / Findbug / CheckStyle integration with Kotlin? There dosent seem to be an official SonarQube plugin (yet) so we are looking for alternatives.
    a
    • 2
    • 1
  • a

    adam-mcneilly

    11/29/2017, 3:01 AM
    Okay, here's one - why is it that when I create an instrumented test in Kotlin, and I try to use the play button in the IDE for that class to run it, it says empty test suite? But if I run
    ./gradlew cAT
    in the terminal, it works fine?
    g
    r
    g
    • 4
    • 8
  • g

    ghosalmartin

    11/29/2017, 10:37 AM
    morning, anyone had any ideas with Kotlin 1.2 and the rx call adapter? the call is made, response comes back and shows in the logging interceptor for retrofit but never comes back to the subscribe function
    g
    l
    l
    • 4
    • 9
  • b

    burak.eregar

    11/29/2017, 12:04 PM
    https://medium.com/@burakeregar/kotlin-rxjava-dagger2-mvp-clean-architecture-easy-unit-testing-5a756c4f2c93
    🤘 1
    s
    • 2
    • 1
  • s

    Scott

    11/29/2017, 2:28 PM
    A little help please? I'm having trouble with an inner class being able to use a function that is declared in the outer class. Not sure why this is happening because the tutorial I'm doing has the same thing but no error. Here is a simplified version of the code with the failing part pointed out by the comment:
    class DAO(){
    
        fun fetchPicture(){
            // Code...
        }
    
        inner class InnerClass : AsyncTask<String, Int, Bitmap>() {
    
            override fun doInBackground(vararg params: String?): Bitmap {
                var network = NetworkingDAO
           // Following line fails with "Unresolved Refereence: fetchPicture"
                network.fetchPicture(picture[0])
            }
        }
    }
    v
    • 2
    • 20
  • i

    itnoles

    11/30/2017, 3:25 AM
    https://stackoverflow.com/questions/31723143/kotlin-uses-runtime-assertions-for-null-checking-performance-overhead is this is still possible?
    f
    • 2
    • 2
  • s

    stkent

    11/30/2017, 3:22 PM
    Maybe a dumb question, but: is the source for the
    kotlin-android
    plugin available, and if so, where does it live?
    p
    • 2
    • 2
  • d

    dave08

    11/30/2017, 4:45 PM
    @jw I suppose you don't use visibility so much... when the activity code is full of them, then it's either eligible for a major refactoring or at the very least have one of these tricks to make it look cleaner...
    r
    • 2
    • 2
  • j

    jw

    11/30/2017, 4:46 PM
    cleaning up interaction with visibility is number 999,999,999 on the list of things that can be improved in every app i've ever seen
    💯 3
  • b

    burak.eregar

    11/30/2017, 5:02 PM
    https://github.com/burakeregar/EasiestGenericRecyclerAdapter
    a
    • 2
    • 1
  • b

    burak.eregar

    11/30/2017, 5:12 PM
    Thanks! Yes, you are right. But I don’t prefer to bind it from presenter. It is view related operation so let your activity to set that list.
    d
    • 2
    • 1
  • m

    moetouban

    12/01/2017, 12:15 PM
    Hi, quick question does anyone know how to use extensions to reference a view included in another view (include) ? am getting IllegalStateException.
    m
    n
    l
    • 4
    • 11
  • b

    burak.eregar

    12/02/2017, 12:33 AM
    https://medium.com/@burakeregar/yet-another-awesome-kotlin-feature-parcelize-5439718ba220
    :kotlin: 1
    b
    z
    • 3
    • 3
  • k

    kchau

    12/03/2017, 10:33 PM
    I need some help with Exoplayer - I have a series of streaming urls, some need HlsMediaSource, some need ExtractorMediaSource. Is there a way to predetermine which MediaSource to construct depending on the type of link, without knowing which one they need ahead of time?
    g
    • 2
    • 2
  • a

    aljosa

    12/04/2017, 2:33 AM
    i’m looking for android application sources for java samples for official tutorials like this one rewritten in kotlin: https://developer.android.com/training/basics/fragments/fragment-ui.html has anyone done this or at least some parts?
    a
    • 2
    • 2
  • a

    anstaendig

    12/04/2017, 7:45 AM
    Anyone in here that knows how to fix missing stdlib functions after upgrading to 1.2?
    v
    • 2
    • 13
  • d

    dave08

    12/04/2017, 12:36 PM
    Hi guys! Anyone got
    Error:(31, 26) 'use((T) -> R): R' is only available since Kotlin 1.2 and cannot be used in Kotlin 1.1. Requires newer compiler version to be inlined correctly.
    updating to 1.2 (from 1.1.51)?
    v
    • 2
    • 5
  • k

    kevin_abrioux

    12/04/2017, 3:48 PM
    Hi, is it possible to connect with A2DP to a BluetoothDevice programmatically ?
    :stackoverflow: 3
    l
    • 2
    • 2
  • r

    rohit1899

    12/05/2017, 5:40 AM
    I have a java class which reads data from some source and casts that data into given class. I pass the class name in which data has to be caste as SomeUserClass.java. How can i pass this info from Kotlin class to java function. I tried SomeUserClass::class.java but it gives me error. This is the java function signature public T getDataFromCache(Class<T> model) { // some operation } and while calling from java i use getDataFromCache(SomeUserClass.class); how can i call this function from Kotlin class ? Thanks in advance
    a
    e
    • 3
    • 9
  • j

    James Coggan

    12/05/2017, 9:43 AM
    @Sudhir Singh Khanger
    1.2.0-release-Studio3.0-1
    is the version you will use as a plugin in AndroidStudio,
    1.2.0
    if for your gradle dependency
    s
    • 2
    • 1
  • j

    jovmit

    12/05/2017, 2:38 PM
    Is there anyone knowing a good article/source of arguments against ReactNative that I can use to confront some ppl in my organization? I’m not too much into it, but from what I follow around it doesn’t seem like a way to go, cause I usually find online more cons then pros. But from business perspective it would save some money. What are your thoughts on this in general?
    k
    l
    • 3
    • 3
  • g

    ghosalmartin

    12/05/2017, 5:46 PM
    anyone had issues with by lazys and paperdb?
    l
    p
    • 3
    • 7
  • u

    urs-vj

    12/06/2017, 7:15 PM
    somewhere i can download ?
    j
    • 2
    • 2
  • g

    gildor

    12/07/2017, 2:56 AM
    Whoa, Android Support Library team interested by Kotlin language feature 👏 https://youtrack.jetbrains.com/issue/KT-4075#comment=27-2588411 Something interesting coming 🤔
    🤔 3
    l
    b
    • 3
    • 13
  • m

    mnawrot

    12/07/2017, 11:32 AM
    hey, how do you usually handle situations, when you need to store for example
    Context
    var/val in your class and in the end you want to clean it/set to null to prevent memory leaks?
    var Context?
    ,
    WeakReference<Context>
    ?
    :stackoverflow: 1
    l
    • 2
    • 1
  • d

    dylan

    12/07/2017, 2:49 PM
    @ibcoleman if you look at parcelable you might also want to check out https://android.jlelse.eu/parcelable-vs-serializable-6a2556d51538 which shows some interesting results.
    l
    • 2
    • 2
  • m

    manijshrestha

    12/07/2017, 7:06 PM
    Is there a way to work around that?
    g
    • 2
    • 1
  • a

    adams2

    12/07/2017, 7:22 PM
    last I checked it was missing some optimizations
    d
    • 2
    • 1
Powered by Linen
Title
a

adams2

12/07/2017, 7:22 PM
last I checked it was missing some optimizations
d

deviant

12/07/2017, 9:25 PM
https://stackoverflow.com/questions/45246268/do-kotlin-android-extensions-cache-the-synthetic-properties-or-each-time-it-call/46646302#46646302
👏 1
View count: 4