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
stackoverflow
  • u

    user

    06/29/2022, 1:11 PM
    How to use work request chaining on Periodic Work Request in work Manager in kotlin I have three work request as below val imageWorker = OneTimeWorkRequestBuilder() .setConstraints(constraints) .addTag("imageWork") .build() val gpSurveyWorker = OneTimeWorkRequestBuilder() .setConstraints(constraints) .addTag("gpSurveyWork") .build() val gpSurveyListWorker = OneTimeWorkRequestBuilder() .setConstraints(constraints) .addTag("gpSurveyList") .build() and I...
  • u

    user

    06/29/2022, 1:31 PM
    MockK Mocking a Surface object for Android I'm trying to test some code, and I need a valid Surface object for Android in order to properly test it, since a lot of the code checks if there is a valid surface (ie surface.isValid() where surface is of the Surface class: https://developer.android.com/reference/android/view/Surface) With MockK, is there a way I can essentially perform this Mock? I have tried the following: private lateinit...
  • u

    user

    06/29/2022, 1:31 PM
    Could not resolve com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5 The app was built in API level 28. Current Android Studio version is 2021.2.1. Now I have migrated the old code to Androidx. Gradle plugin and all the dependencies are updated properly but getting this following error on build : "Could not resolve com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5" // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { //ext.kotlin_version = '1.7.0' repositories {...
  • u

    user

    06/29/2022, 1:51 PM
    Facebook AppLinkData.fetchDeferredAppLinkData is returning null in android I am using deferred deep link in my project, when I click the notification from facebook app it must navigate to my app and return the appLinkData. For the first time if I click the notification it navigates to my app and AppLinkData.fetchDeferredAppLinkData function returns the appLinkData value and if I click next time AppLinkData.fetchDeferredAppLinkData is returning null value for appLinkData. AppLinkData.fetchDeferredAppLinkData(this) { appLinkData -> when{ appLinkData != null -> {...
  • u

    user

    06/29/2022, 1:51 PM
    How can I connect AWS IOT core to android app with MQTT I found an exemple of MQTT here : https://github.com/leonardocavagnis/MQTTClientSample_Android But I tried to connect it with AWS IOT Core to use Rekognition. I couldn't find an exemple how to use the certificate to connect. I tried ssl://"amazon URL":8883 but I couldn't connect. Someone know the solution how to had Certificate ?
  • u

    user

    06/29/2022, 1:51 PM
    binding.bottomNavigationView.setupWithNavController doesn't work I'm developing an Android app, in which I utilize both Android Navigation Component and BottomNavigationView. The problem is that assigning setupWithNavController to my BottomNavigationView, and when i run the app is crashed and generate java.lang.RuntimeException error Code NewsActivity.ky import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import androidx.lifecycle.ViewModelProvider import androidx.navigation.findNavController import...
  • u

    user

    06/29/2022, 1:51 PM
    Compose View instead of Native view for marker's info window I am using compose maps library to display clusters of markers. Now to display a custom info window adapter I want to use the compose. I have followed the documentation of interoperability of compose via ComposeView. but when I add the ComposeView inside the info window method I am getting this error of cannot locate window recomposer. Cannot locate windowRecomposer; View...
  • u

    user

    06/29/2022, 1:51 PM
    Jetpack Compose Instantiate a Class from Composable I have my following logic class class Logic(){ private val state: MyViewModel = MyViewModel() @Composable fun PublicComposable(){ Text("My public composable") } fun setSomething(value:String){ state.setSomething(value) } fun getSomething(){ return state.getSomething() } } I have my ViewModel which should not be accessible to the UI but only to the Logic class class MyViewModel():ViewModel(){ private val _capturedCard:...
  • u

    user

    06/29/2022, 2:11 PM
    io.getstream:stream-chat-android-ui-components dont run app in android studio - compose I use implementation "io.getstream😒tream-chat-android-ui-components:4.8.1" for starting chat project with compose but can not run , just build successfully.
  • u

    user

    06/29/2022, 2:11 PM
    How to add items to MutableLiveData arraylist? I have a MainViewModelwith the code: private val locationList: MutableLiveData = MutableLiveData() fun getLocationList(): MutableLiveData = locationList and a fragment where I am trying to add values to the arraylist, but I don't know how: mainViewModel.getLocationList.value = arrayListof(location) //creates always a new list Maybe someone can help me. Thank you
  • u

    user

    06/29/2022, 2:11 PM
    Why users still login firebase even they do not register to app in jetpack compose? I have login screen in android jetpack compose, so when I register with e-mail to firebase, I can login to app with below codes, but when I typing random e-mails which I never register, I can login to app, how can I control my login function if I do not have register e-mail, user will never success to login my app? viewmodel: @HiltViewModel class ViewModel @Inject constructor( val db: FirebaseFirestore, val auth: FirebaseAuth, ) : ViewModel() {...
  • u

    user

    06/29/2022, 2:51 PM
    Kotlin Android Room Composite primary key many to many relation I have got two tables: equipment and location. Equipment table has composite primary key consisted of columns "component_id", "id". Location table has primary key "id". Could you show me the way how to create many to many relationship in room with composite key? @Entity( tableName = "equipment", primaryKeys = ["component_id", "id"], ) data class EquipmentModel( @ColumnInfo(name = "component_id") val componentId: Int, @ColumnInfo(name = "id") val id: Int, @ColumnInfo(name =...
  • u

    user

    06/29/2022, 2:51 PM
    Such code has application now?- code (args : Array<String>) Question. For a new student who has just started learning the Kotlin programming language- no longer need to know about this code (args : Array) fun main(args : Array) ? since Starting with Kotlin 1.3, the explicit Array can be omitted, but it will still be available in bytecode. A new Kotlin student can just know the code - fun main(){} and that's it? or do you need to know fun main(args : Array) , since such code has application now? Thank you in advance for the answer.
  • u

    user

    06/29/2022, 2:51 PM
    Read plain text with special characters with Gson while using Retrofit I have to retrieve data from a rest api which just returns a plain String with the text/plain header while using Retrofit. I want to convert the plain String with special characters to a String without removing any of the special characters. The response from the rest API is just something like this: kjkj32984923hjk/j34jhjk+= As you can see it is just a plain String without any json formatting. The problem is that parsing this response with Retrofit results in the following error:...
  • u

    user

    06/29/2022, 3:11 PM
    How to display html in Thymeleaf that contains inline style with quotes I've some html styled text that I want to display in the Thymeleaf template. To display the html, I'm using th:utext="${myVariable}", however, I'm getting an error: Element type "span" must be followed by either attribute specifications, ">" or "/>". It's may be because the html looks like this:
  • u

    user

    06/29/2022, 3:31 PM
    Catching an error while Spring injects a value I'm using Spring to inject a GCP Secret into a variable, using the following code: @Value("\${secret_name:{}}") private lateinit var secretValue: String In my application.yaml file I map secret_name to GCP's Secret Manager to a secret that doesn't necessarily exist (depending on the environment). If this secret doesn't exist I get the following error, while trying to run my application: Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with...
  • u

    user

    06/29/2022, 3:31 PM
    How to add drawable's next to textfield in jetpack compose? I am trying to figure out how to add a drawable to a text within a textfield (OutlinedTextField) but without any success. I have already created a drawable in the drawable folder. Do I need to create a seperate composable to insert it or can I directly add it inside the textfield ? This is my textfield in the composable: Spacer(modifier = Modifier.height(20.dp)) OutlinedTextField( value = username.value, onValueChange = { newText ->...
  • u

    user

    06/29/2022, 4:11 PM
    Why are the results inconsistent after two compilations androidx.core.graphics.Color.kt I compared the compilation results of the app twice, but the binary comparison of the compilation results after decompiling is different

    enter image description hereâ–¾

  • u

    user

    06/29/2022, 4:11 PM
    How to retrieve the list of all GitHub repositories of a person? parsing json list with no key value I know this question has been answered at this post with same question. however, my question is the Json response by the most upvoted answer will be a json list with no key value. (you can also check the sample json from the official github website) I am using...
  • u

    user

    06/29/2022, 4:31 PM
    Class Not Found When Unmarshalling: com.example.Parcelable.User I'm facing following Errors/Exceptions when receiving data from one App to another App in Kotlin (Android): Class Not Found When Unmarshalling: com.example.Parcelable.User mExtras=Bundle[{)}] mParcelledData=null mMap=size 0 Also, In MainActivtiy: if(intent.hasExtra("USER")) statement giving error and displaying Toast message written in Else statement. Please help me how I can resolve these exceptions ? Thanks a Lot! (SendingApp File) -> MainActivity.kt btnSendData1.setOnClickListener {...
  • u

    user

    06/29/2022, 5:31 PM
    The version of the Android cannot open this project When i run my project i l've got this error : This version of the Android Support plugin for IntelliJ IDEA (or Android Studio) cannot open this project, please retry with version 2021.2.1 or newer. The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin. I update all...
  • u

    user

    06/29/2022, 5:31 PM
    Two instances of the same network when searching wifi network I am trying to connect to a device via wifi final WifiNetworkSpecifier wifiNetworkSpecifier = new WifiNetworkSpecifier.Builder() .setSsidPattern(new PatternMatcher(networkSSIDPattern, PatternMatcher.PATTERN_PREFIX)) .setWpa2Passphrase(passWord) .build(); final NetworkRequest networkRequest = new NetworkRequest.Builder() .addTransportType(NetworkCapabilities.TRANSPORT_WIFI)...
  • u

    user

    06/29/2022, 5:51 PM
    Time-consuming mapping of Flux and Mono into DTO I've got 2 end-points returning the same data in two different JSON-formats. The first end-point returns a JSON-array, and starts the response right away. @Get("/snapshots-all") fun allSnapshots( @Format("yyyy-MM-dd") cutoffDate: LocalDate ): Flux = snapshotDao.getAllSnapshots(cutoffDate) The next end-point that returns a paged result, is more sluggish. It starts the response when both streams are completed. @Get("/snapshots") fun snapshots( @Format("yyyy-MM-dd") cutoffDate:...
  • u

    user

    06/29/2022, 6:11 PM
    Why I am not able to use log out for users in android jetpack compose? I have simple login app, user can login to app easily, but when click the logout, it is not working for logut the users in firebase, I don't know what I missed, any idea? viewmodel: @HiltViewModel class MyViewModel @Inject constructor( val auth: FirebaseAuth, ) : ViewModel() { fun onSignOut() { auth.signOut() } } screen: @Composable fun HomeScreen( navController: NavController, model: MyViewModel ) { OutlinedButton( modifier...
  • u

    user

    06/29/2022, 7:11 PM
    How to change the Activity when app is moved to background and then again when it is resumed? my goal is to make my Password Manager app's current visible activity (e.g. MainMenuActivity) change to EmptyScreenActivity when app is paused (so nobody can see the passwords when the app is in background) and then run LoginScreenActivity when the app is resumed for user to log back in. I used this code by vokilam to implement LifecycleObserver and it works pretty well but I'm stuck because there is no option to pass the Intent to...
  • u

    user

    06/29/2022, 7:51 PM
    android best linter what is the more efficient linter which can be used with android studio? I need a fast one in which We can find with it kotlin and xml code smells I tried the Android studio built in lint but it is too slow
  • u

    user

    06/29/2022, 8:11 PM
    Compose : how to stock a list of composable files I wanted to make a list of all the elements I would draw in my composable fragment. And make it as easy to maintain as possible. So I thought, I should not put the list of elements inside my fragment, but outside, in a class that will stock and order those elements. Here is the solution I came with : interface SimpleDraw { @Composable fun Draw() } Create differentes implementation of my interface class WelcomeBottomSheetElementsImpl : WelcomeBottomSheetElements { override...
  • u

    user

    06/29/2022, 8:11 PM
    When retrofit2 won't return me Call in a typical implementation of CallAdapter.Factory()? Given following implementation of Retrofit2 CallAdapter.Factory(): override fun get( returnType: Type, annotations: Array, retrofit: Retrofit ): CallAdapter? { // suspend functions wrap the response type in
    Call
    if (Call::class.java != getRawType(returnType)) { return null } ... } If returnType is null, Utils.getRawType will throw NullPointerException. How I can make retrofit to return me WildcardType or any other expected by method getRawType type that...
  • u

    user

    06/29/2022, 8:51 PM
    Flow doesn't trigger in other class I have firebaseManager where I have my readData function which is used in another fragment, I would like to achieve this goal when the firebasemanager is done I trigger function in homefragment and refresh UI to display data. fragment class HomeFragment : Fragment() { var _setGoalsData = MutableStateFlow(0) val setGoalsData = _setGoalsData.asStateFlow() override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view,...
  • u

    user

    06/29/2022, 9:31 PM
    Recyclerview move to penultimate position when the list is update Currently i have the next config. RecyclerView + MutableLiveData + DiffUtils The behavior is: When i move to the last position and update the list, the RecyclerView move automatically to penultimate item, but only happen with the last position
Powered by Linen
Title
u

user

06/29/2022, 9:31 PM
Recyclerview move to penultimate position when the list is update Currently i have the next config. RecyclerView + MutableLiveData + DiffUtils The behavior is: When i move to the last position and update the list, the RecyclerView move automatically to penultimate item, but only happen with the last position
View count: 6