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

    Marcelo

    11/27/2018, 10:23 PM
    And also anyone know a good a library to generate a report in PDF ?
    r
    a
    • 3
    • 3
  • c

    ClaudiuB

    11/28/2018, 1:03 PM
    Can your non-null fields in `Fragments`/`Activity` ever have null values? Like when a fragment has been removed or an activity has been finished. I end up having stuff nullable, because even tho I can guarantee that an object has been initialised as part of the lifecycle, I'm unclear what happens when the fragment/activity is destroyed in terms of the instance of the class itself. Any reading material and opinions would be great
    c
    a
    g
    • 4
    • 8
  • g

    geeksweep

    11/28/2018, 7:46 PM
    is there a good resource for android that uses the visual editor instead of just XML? also there seems to be a lot of tutorials out there tat still use the findID stuff that you dont have to worry about anymore in Kotlin
    g
    • 2
    • 2
  • s

    spierce7

    11/28/2018, 9:07 PM
    Hey, I distinctly remember a new feature for android being released where we can prompt the user to update to the latest version of our app. Does anyone know what this is called? I can't seem to find any information about it
    s
    • 2
    • 1
  • i

    itnoles

    11/28/2018, 9:11 PM
    @spierce7 https://www.androidpolice.com/2018/11/07/app-updates-api-will-let-android-apps-update-use/
    s
    • 2
    • 2
  • d

    dewildte

    11/28/2018, 9:15 PM
    Can you find me a Android TextView specific slack channel then?
    o
    s
    • 3
    • 4
  • l

    leosan

    11/28/2018, 11:12 PM
    Hi I have something like this where my RecyclerViewHolder delegates the creation of the layout to this adapter, is there a way where I can use
    LayoutContainer
    here in order get cached synthetic views? I Can't find a way to work 😕 LayoutContainer requires the
    containerView
    initialized at the class initialization but there's no way I can get it on the delegate initialization, only on the
    bindView
    class HeadlineDelegateAdapter @Inject constructor() : BaseDelegateAdapter {
    
        override fun getLayoutRes(): Int = R.layout.item_dashboard_transaction_headline
        override fun bindView(itemView: View, item: BaseViewType, viewHolder: RecyclerView.ViewHolder) {
            if (item is Headline) {
                tvHeadline.text = item.description
                tvSubtotal.text = item.subtotal
            }
        }
    }
    k
    • 2
    • 4
  • p

    Paul Woitaschek

    11/29/2018, 6:59 AM
    It's a field of ViewHolder and you return that.
    l
    • 2
    • 72
  • p

    Paul Woitaschek

    11/29/2018, 3:27 PM
    Who will change that? @alan
    r
    a
    • 3
    • 5
  • d

    dpk

    11/29/2018, 4:29 PM
    using kotlin android extensions with two different layout xmls for the same custom class, where the two layouts use the same ids for views that are different but share a common base class (something like
    Button
    and
    TextView
    ), is there a built-in way to tell KAE to cast views to a specific base class when reading from its cache? for now i’m stepping out of KAE and just using
    findViewById<Base>(R.id.whatever).property = blah
    . i saw some discussion of customizing the cache but haven’t figured out where the code for that is.
    n
    l
    • 3
    • 3
  • j

    jw

    11/29/2018, 8:00 PM
    it's still there: https://android.googlesource.com/platform/frameworks/support/+/androidx-master-dev/core/ktx/src/main/java/androidx/core/widget/TextView.kt#56
    g
    • 2
    • 3
  • a

    alexsullivan114

    11/29/2018, 9:13 PM
    I can definitely understand that rationale for breaking up RxAndroid. The issue I've encountered is that when the question is wrap it myself or use a library for an individual feature, like a location wrapper, I almost always just wrap it myself to avoid bringing in another library. But that ends up being a non trivial amount of time wrapping individual components. Of course, that's ultimately on me and I could just adjust my mindset and be more liberal about including libraries. Still, I do see value in a broader library focused on rx-ifying common android flows.
    l
    • 2
    • 2
  • l

    lukaville

    11/30/2018, 5:23 PM
    any one knows why android extensions are still experimental? it means that api can be changed or current implementation is not stable (or both)? specifically I’m interested in parcelable generation using
    @Parcelize
    g
    c
    • 3
    • 7
  • h

    Hank

    12/01/2018, 7:47 AM
    Hello everyone, I have a composite view (TextView + EditText), I want reuse “inputType” in my both view, but there was an error, how can I fix it? thanks for help.
    :stackoverflow: 3
    • 1
    • 1
  • t

    Tolriq

    12/02/2018, 3:36 PM
    Yes byte code generated have subtle bug most are fixed in AGP 3.3 RC1 but there's still at least one big that can trigger random bugs on Android 8 / 9
    l
    • 2
    • 5
  • a

    ankit.sharma

    12/02/2018, 9:17 PM
    Heya everyone! 👋 I’m a noob to kotlin and had this question. I’m trying to build a retrofit service class in kotlin and saw two approaches and not sure which one is better. 1. In the
    RetrofitApi.kt
    interface, define a companion object which returns a service object. 2. Define a separate class and instantiate the object in
    init {}
    . Is there a recommended way of doing things on android and what are the pros and cons of each approach? Thanks!
    g
    • 2
    • 1
  • m

    mingkangpan

    12/02/2018, 10:40 PM
    hello, I have a question which java bytecode does kotlin compiler targets per default? java 6? does it make the compiler faster if I say I target java 8? with
    compileKotlin {
        kotlinOptions {
            jvmTarget = "1.8"
        }
    }
    our android app supports min android SDK 21
    g
    k
    • 3
    • 5
  • t

    thuytrinh

    12/03/2018, 10:52 AM
    Has anyone tried inline classes with Mockito and encountered this issue https://github.com/nhaarman/mockito-kotlin/issues/309? Any workaround so far?
    😱 1
    r
    s
    • 3
    • 8
  • j

    jurajsolarml

    12/03/2018, 1:50 PM
    Hello,please help.AS 3.2.1,Kotlin,Gradle 5.0.I'm writing a mistake. How do I fix it? Thank you Cause: org.jetbrains.plugins.gradle.tooling.util.ModuleComponentIdentifierImpl.getModuleIdentifier()Lorg/gradle/api/artifacts/ModuleIdentifier;
    c
    • 2
    • 27
  • j

    jurajsolarml

    12/04/2018, 9:32 AM
    Hello,please help.AS 3.2.1,Kotlin,Gradle 5.0.I'm writing a mistake. How do I fix it ? Thanks https://hastebin.com/irobokatax.nginx https://hastebin.com/lerifoluqu.http
    g
    • 2
    • 16
  • a

    avezraj

    12/04/2018, 9:45 AM
    can't use data binding in kotlin Unresolved reference: databinding . Is any solution for this ?
    g
    p
    +2
    • 5
    • 8
  • ö

    Ömer Ateş

    12/05/2018, 9:20 AM
    Hi :) how to template pdf file on write text(dynmic)
    :stackoverflow: 1
    s
    • 2
    • 1
  • d

    dvlwj

    12/05/2018, 9:33 AM
    can i ask something about firebase in here?
    :stackoverflow: 2
    g
    • 2
    • 5
  • d

    dvlwj

    12/05/2018, 9:33 AM
    i got some problem about fcm
    s
    • 2
    • 3
  • g

    gsala

    12/05/2018, 10:22 AM
    I really wish the Android community had an official Slack as well
    g
    • 2
    • 8
  • j

    jurajsolarml

    12/05/2018, 10:23 AM
    Hello,please help.AS 3.4.Canary 6,Kotlin,Gradle 5.0.I'm writing a mistake.How can I fix it? Thanks Gradle sync failed: tried to access method kotlin.collections.ArraysKt___ArraysKt.copyOfRange([Ljava/lang/Object;II)[Ljava/lang/Object; from class kotlin.reflect.jvm.internal.calls.CallerImpl$Method$Instance (20 s 816 ms)
    a
    • 2
    • 3
  • c

    CamilleBC

    12/05/2018, 10:33 AM
    Hello ! I'm using retrofit to get some data from a website. What is the best practice to return data from a call
    onResponse
    ? Should I: * pass a callback and send the data back through it? * use the https://github.com/gildor/kotlin-coroutines-retrofit library? * pass a LiveData as parameter to the
    call
    function and post the value to it?
    g
    • 2
    • 17
  • f

    filiplamparski

    12/05/2018, 6:23 PM
    My view hierarchy is roughly (activity -> frame layout -> (fragment -> drawer layout [fits system windows] -> nav drawer [fits system windows] + frame layout [fits system windows] -> (coordinator layout and all that jazz)))
    e
    • 2
    • 1
  • j

    Jakub

    12/06/2018, 10:15 AM
    1) Implement getter with logic
    -.kt
    m
    a
    • 3
    • 3
  • j

    jurajsolarml

    12/06/2018, 12:14 PM
    Hello,please help.AS 3.4. Canary 6,Kotlin,Gradle 5.0.I'm writing a bugs.The application can not run. The error occurred after the transition to AS 3.4. I use Java 11. I tried JAVU 8 without change. How do I fix it? Thank you
    g
    • 2
    • 15
Powered by Linen
Title
j

jurajsolarml

12/06/2018, 12:14 PM
Hello,please help.AS 3.4. Canary 6,Kotlin,Gradle 5.0.I'm writing a bugs.The application can not run. The error occurred after the transition to AS 3.4. I use Java 11. I tried JAVU 8 without change. How do I fix it? Thank you
g

gildor

12/06/2018, 1:16 PM
Move out plugin application out of dependencies block
j

jurajsolarml

12/06/2018, 1:30 PM
do you have the idea to clear the google-service plugin?
g

gildor

12/06/2018, 1:46 PM
clear it?
j

jurajsolarml

12/06/2018, 1:47 PM
Yes
g

gildor

12/06/2018, 1:47 PM
I don’t understand what you mean
You have this error because you try to apply this plugin from dependencies block and this resolved to dependencies configuration lookup instead of plugin application
j

jurajsolarml

12/06/2018, 1:51 PM
After deleting the plugin google-services: https://hastebin.com/fubobeyuya.http
Can I send you an app to view it pls ?
g

gildor

12/06/2018, 3:23 PM
Maybe some bug with Gradle 5.1-miletone1, this is some exception with build cache, try to delete it probably,this is pre-release version, I wouldn’t recommend to use it if you don’t have particular reasons.
j

jurajsolarml

12/06/2018, 3:56 PM
https://hastebin.com/ufodujiluh.http
g

gildor

12/06/2018, 4:05 PM
as I said, some problem with Gradle itself, try to use Gradle 5.0
j

jurajsolarml

12/06/2018, 4:30 PM
I changed to 5.0 Gradle the same bug, I also wrote to Channel Gradle
g

gildor

12/06/2018, 5:11 PM
https://stackoverflow.com/questions/32513740/gradle-build-failure-could-not-open-proj-class-cache-for-build-file
j

jurajsolarml

12/06/2018, 6:54 PM
I tried to clear the cache and .gradle and Upgrade on Canary 7 all the same, did not help https://pastebin.com/jBMktgEw
This helped me, Upgrade, Apk Works: https: //stackoverflow.com/questions/29087882/android-studio-run-debug-configuration-error-module-not-specified/29087954
View count: 2