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

    rss

    03/22/2023, 11:31 AM
    Intellij idea support jsonata language I am a developer and our team is actively using the jsonata language. I am developing a plugin for intellij idea (https://github.com/RabotaRu/DocHubIdeaPlugin) to support your language, tell me if someone has a description of the grammar of the language, "bnf file" (<a href="https://plugins.jetbrains.com/docs/intellij/grammar-and-parser.html#define-the-grammar" rel="nofollow...
  • r

    rss

    03/22/2023, 12:11 PM
    Will it enough only to include the Apache license file in the source code in android kotlin application? I have been implementing an Android application using Kotlin and thought of using the KOIN library for dependency injection. However, it is licensed under the Apache 2.0 license which has become a huge concern to me since I am unaware of what steps I need to follow to abide by its terms and conditions. I've included the link for their license file: <a href="https://github.com/InsertKoinIO/koin/blob/main/LICENSE" rel="nofollow...
  • r

    rss

    03/22/2023, 12:31 PM
    Context parameter (in context receivers functionality) not showing via reflection Via reflection, I need to distinguish between a method with a context and a method without a context (Kotlin 1.8.0). Let's say we have following dummy context and a class with two functions - one with the context, second without. class Context(val a: Int) class Foo { context (Context) fun bar() = a fun baz() = 1 } In runtime, we don't know which method is which, so let's try to distinguish them via reflection. val foo = Foo() val barMethod =...
  • r

    rss

    03/22/2023, 1:31 PM
    Cannot select "None" subtitle option on ExoPlayer I use ExoPlayer to play videos in my app, subtitles of which I fetch through some API endpoint. They show up just fine, with the first one autoselected, however, when trying to disable the subs, by clicking the "None" option provided by ExoPlayer it does nothing. This is how I create the SubtitleConfigurations list(subs are all .vtt): val list = arrayListOf() captions.forEach { caption -> caption.resourceUrl?.let { url -> val subtitle =...
  • r

    rss

    03/22/2023, 1:51 PM
    What library should I use for MQTT protocol in android? I've recently started an android project and I need to communicate with the backend using the MQTT protocol. I've found two libraries that can be used: hive mq eclipse paho. Which one do you suggest to use?
  • r

    rss

    03/22/2023, 2:11 PM
    Spotbugs and gradle tasks I created a spot bugs task in gradle, but I believe it is not configured correctly, because, in the log, it does not report any bugs. And when I use the intellij plugin it always catches bugs. what am I doing wrong? spotbugs { toolVersion.set("4.7.3") showProgress.set(true) ignoreFailures.set(false) showStackTraces.set(true) effort.set(com.github.spotbugs.snom.Effort.MAX_VALUE) reportLevel.set(com.github.spotbugs.snom.Confidence.DEFAULT)...
  • r

    rss

    03/22/2023, 2:11 PM
    Render problems cardstackview in android studio

    https://i.stack.imgur.com/vgi3K.png▾

    I have installed CardStackView 2.3.4 but when I use it it gives me render problems Anyone like me , can help me to solve this problem ?
  • r

    rss

    03/22/2023, 2:31 PM
    Is there a way to programatically add strings from a xml resource to a list using a loop? Is there a way to programatically add strings from a xml resource to a list using a loop? For example, I have the following string.xml: Text 1 Text 2 Text 3 In my MainActivity.kt I want to add the strings to a mutableListOf called stringList var i = 1 do { stringList.add(getString(R.string.string)) //Add each R.string.string1->R.string.string3 i++ }while (R.string.string != null)
  • r

    rss

    03/22/2023, 3:11 PM
    Kotlin, webview application, page resume as the title suggests, I am able to connect and view the pdf link. However, when I close the application and open it again, it does not open from the page I left off. Am I doing wrong? I'm doing my operations with my code snippet below. class DetailsActivity : AppCompatActivity() { private lateinit var b: ActivityDetailsBinding private lateinit var webView: WebView private var currentState: Bundle? = null override fun onCreate(savedInstanceState: Bundle?) {...
  • r

    rss

    03/22/2023, 3:11 PM
    How to enable "Simplified View for Web Pages" setting programmatically I need to enable "Simplified View for Web Pages" setting in Accessibility settings. Is there any way I can do this? Your help will be appreciated. Happy coding.

    https://i.stack.imgur.com/zV4wJ.png▾

  • r

    rss

    03/22/2023, 3:31 PM
    Google Pay API using CyberSource Payment Gateway I am trying to implement the Google Pay payment method in my mobile application using cybersource Payment gateway. I refer this example/tutorial for the reference and checked the implementation. I configured the gateway name and merchant ID in the demo snippet and getting the success and google payment token in the success response. When i tried to implement the same code in my actual app i...
  • r

    rss

    03/22/2023, 3:31 PM
    fillParentMaxWidth and clip not working together I've noticed that in the image I'm using that had a clip modifier, said modifier stopped being applied when I added the fillParentMaxWidth modifier. I need both the image's edges to be rounded and I need to show 3 images at the same time in my lazy row but since the clip modifier doesn't work with it (no matter the order), I'm at a loss. Any ideas? Image( modifier = Modifier .clip(RoundedCornerShape(30.dp))...
  • r

    rss

    03/22/2023, 3:31 PM
    Setting up a retry button to request again for permissions in android kotlin I wrote a permission handling code to handle multiple permission properly. //exception handling and cancellation management private val errorHandler = CoroutineExceptionHandler { _, throwable -> Log.e("SplashActivity", "Exception Error: $throwable") } private var multiplePermissionsLauncher = registerForActivityResult( ActivityResultContracts.RequestMultiplePermissions() ) { results -> var areAllPermsGranted = true for (isGranted in results.values) {...
  • r

    rss

    03/22/2023, 3:51 PM
    How can I test passing data across graphs and routes with jetpack compose navigation? Here's my code class NavigationTest { @get:Rule(order = 0) val hiltRule = HiltAndroidRule(this) @get:Rule(order = 1) val composeTestRule = createComposeRule() lateinit var navController: TestNavHostController @OptIn(ExperimentalMaterialNavigationApi::class) @Before fun setupAppNavHost() { hiltRule.inject() composeTestRule.setContent { navController = TestNavHostController(LocalContext.current)...
  • r

    rss

    03/22/2023, 3:51 PM
    Why is the Firebase Cloud Messaging notification not being received even though the request returns a 200 OK status code? `object Constants { fun showNotification(context: Context, id: Int, title: String?, body: String?, intent: Intent?) { Toast.makeText(context, "showNotification called", Toast.LENGTH_SHORT).show() var pendingIntent: PendingIntent? = null if (intent != null) { pendingIntent = PendingIntent.getActivity(context,id, intent, PendingIntent.FLAG_UPDATE_CURRENT) val NOTIFICATION_CHANNEL_ID = "com.example.uberclone" val notificationManager =...
  • r

    rss

    03/22/2023, 5:11 PM
    kotlin coroutine parent child relationship can anyone explain whats the difference between these 3 coroutines from the viewModelScope? viewModelScope.launch { launch {} launch {} } viewModelScope.launch { viewModelScope.launch {} viewModelScope.launch {} } viewModelScope.launch { coroutineScope { launch {} } coroutineScope { launch {} } } im pertty sure for...
  • r

    rss

    03/22/2023, 5:11 PM
    Move to View Biding for Adapter: Can't get it working I want to make the move to View Binding in order the migrate to the 1.8.0 of the Gradle Plugin. I found a lot of posts but somehow I can't get it working for my Adapter: class JustPlayedAdapter: RecyclerView.Adapter() { private var context: Context? = null override fun getItemCount(): Int { return lastPlayed.count() } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): JustPlayedViewHolder { val layoutInflater =...
  • r

    rss

    03/22/2023, 5:31 PM
    Kotlin RefreshScope making empty Configuration boot:2.6.4 cloud:2021.0.1 My kotlin configuration is inherited from another class. If i add RefreshScope annotation, spring create empty CGLib wrapper with null field for my configuration demo project run...
  • r

    rss

    03/22/2023, 5:51 PM
    DaggerHilt @Singleton injection returning diferent instances So I have ann Android app with dagger hilt that its injecting dependencies, but when I'm using the viewmodel alongside the SyncAdapter it receives an different instance of TableDao which causes my observables in the viewmodel to not update in real-time when the SyncAdapter insert or updates data in the table from retrofit service @AndroidEntryPoint class SyncService:Service() { @Inject lateinit var syncAdapter: SyncAdapter ... } class SyncAdapter @Inject constructor( private...
  • r

    rss

    03/22/2023, 6:31 PM
    How to resolve and Unresolved reference in auto generated code

    enter image description here▾

    When i change the R import to ¨import com.example.runningtracker.R¨ it also gives the same error i think it is supposed to finds the proyect but, i do not know how to fix it. change the import R to import com.example.runningtracker.R to see if it can find the project.
  • r

    rss

    03/22/2023, 6:51 PM
    About Kotlin Scripts I have a shell script that basically copies some .ttf files from a node_modules and pastes these files into my assets/fonts folder. I would like to know if it is possible to write a library that would be in a nexus repository using Android/Kotlin capable of copying these .ttf files and when the library was declared in the gradle dependencies, the fonts would already go straight to the assets/fonts folder or res/font without needing the shell script. I don't want anything ready, but I would...
  • r

    rss

    03/22/2023, 7:31 PM
    Android (Kotlin) Canvas undo operation problem Working on a draw project. The code is working, but the one thing, that i cant fix - undo operation. Its work only for SmoothLine, not for Line, Recnagle e.t.c. class MyCanvasView(context: Context, attrs: AttributeSet?): View(context, attrs) { companion object { const val SMOOTHLINE = 1 const val LINE = 2 const val RECTANGLE = 3 const val SQUARE = 4 const val CIRCLE = 5 const val TRIANGLE = 6 } var mCurrentShape = 1 private val paint = Paint() private var scaleFactor...
  • r

    rss

    03/22/2023, 9:11 PM
    Getting "Field 'dwell time' is not a java.lang.Number" error when retrieving data from Firebase Firestore I'm working on an Android project that uses Firebase Firestore to store data. I'm trying to retrieve a document from the Firestore database and get the value of a field called "dwell time" which is a number, but I keep getting the following error: java.lang.RuntimeException: Field 'dwell time' is not a java.lang.Number I'm using the getLong() method to retrieve the value of the field, but it seems like the field is not being recognized as a number. Here's the code that I'm using: package...
  • r

    rss

    03/22/2023, 10:31 PM
    I'm struggling to retrieve a number from Firestore Firebase database in Kotlin I'm a newbie in firestore and Android Development, and I'm doing an app challenge. In this app I need to store some quantities of items in a firestore database, to update them when i remove or add items in the app. I wish to take a field in the document to set it as a variable, so I can do the maths in the function. Here is the farthest that I could make: fun getQuantity(name: String) { db.collection("Coin").document(name) .get() .addOnSuccessListener {...
  • r

    rss

    03/22/2023, 11:11 PM
    Android 13 (target SDK 33) Media Notification Changes, controls not showing I am attempting to use target sdk 33 in my media app. According to Google, The media controls are now derived from PlaybackState (https://developer.android.com/about/versions/13/behavior-changes-13#ux) Currently, I only use a stop action in my notification: private fun buildNotification(imageBitmap: Bitmap?, item: MediaItem){ val builder = NotificationCompat.Builder(this,...
  • r

    rss

    03/22/2023, 11:11 PM
    Rust in Docker with ability to run kotlinc I have a Rust GUI application (uses fltk-rs) that runs Kotlin scripts and I'd like to dockerise it. How do I go about loading both compilers and should I have separate containers for each compiler? Here's my Dockerfile: FROM rust:latest # Install Kotlinc and X11 packages RUN apt-get update && \ apt-get install -y openjdk-11-jdk libx11-xcb1 libxcb-dri3-0 libxtst6 libgtk-3-0 curl unzip && \ curl -sSL...
  • r

    rss

    03/22/2023, 11:31 PM
    Jetpack Compose - Add contentPadding to BottomNavigation elements I'm trying to be pixel perfect on this design

    https://i.stack.imgur.com/RTsMo.png▾

    Thing is that I don't have contentPadding inside the main BottomNavigation composable and I cannot add these padding to the elements inside. Also, I do not found a way to add that rounded corners as the image for it, I tried using graphicsLayer and seems to not draw any shape into is, any ideas ? This is my code BottomNavigation(modifier = Modifier.graphicsLayer { shape =...
  • r

    rss

    03/23/2023, 1:51 AM
    Can't change item color in recyclerview I can't change the color when the item is pressed Here is my code I have tried many ways but it doesn't seem to work In the adapter, binding.apply { barFilled.apply { val color = context.getColor(R.color.selector_item_chart) backgroundTintList = ColorStateList.valueOf(color) var percentStepCounter: Float = (item.stepCounter.toFloat() / ConstantNumber.MAX_STEP.toFloat()) if...
  • r

    rss

    03/23/2023, 3:11 AM
    Is `last_insert_rowid()` thread-safe in SQLDelight/JdbcSqliteDriver? I need to perform a bunch of correlated insertions into an sqlite3 database. For this, I'm doing so over a transaction that looks a bit like this (oversimplified): db.transaction { q.insertBook(title) // books table, titles are not unique val bookId: Long = q.getLastRowId().executeAsOne() val tagId: Long = try { q.insertTag(tagName) // tags table, unique names q.getLastInsertRowId().executeAsOne() } catch(e: SQLiteException) { // throw again if the error is...
  • r

    rss

    03/23/2023, 7:51 AM
    Facing issue in Biometric Authentication in android I implemented biometric authentication using java . it authenticate first time correctly . when i try to authenticate second time it does not call its callback also enable & disable switch for biometric did not work I tried to authenticate secondtime using biometric after successfully authentication . but it does not authenticate user , it remain on same screen
Powered by Linen
Title
r

rss

03/23/2023, 7:51 AM
Facing issue in Biometric Authentication in android I implemented biometric authentication using java . it authenticate first time correctly . when i try to authenticate second time it does not call its callback also enable & disable switch for biometric did not work I tried to authenticate secondtime using biometric after successfully authentication . but it does not authenticate user , it remain on same screen
View count: 1