Category "kotlin"

Recycler View life cycle methods

The flow of recycler view function call is: getItemCount() -> getItemViewType() -> onCreateViewHolder() -> onBindViewHolder() The size of array list i

Data not visible

My Variable Class data class QnaVariable( val questionOne: String, val answerOne : String, val questionTwo: String, val answerTwo : String) My ViewModel Class

Background Location with workmanager

How to get the location while app is in background periodically and execute some task supportive with android 12 ?

Android check internet connection in kotlin

I need to check if the device have internet connection, I search for some examples but when i copy and paste the code i always get errors or deprecated function

no build output compiled for common module of Kotlin Multiplatform project

I'm trying to figure out why dependent projects for my Kotlin MPP library don't see any provided modules in their common modules even though the targets (jvm, a

ClassNotFoundException in navigation graph android

I saw this crash over firebase and it is not reporducible in the emulator of same OS. Not sure what is causing it. Crash is occuring in samsung M32 OS 11. The c

How to compare date and time in kotlin android?

I have an app on the PlayStore and I am building a feature where the user will not see ads more than a specific number in one day. I am thinking about comparing

Using rememberCoroutineScope() vs LaunchedEffect

Context In Jetpack compose, we have the option of using rememberCoroutineScope() as well as using the LaunchedEffect composable in order to use coroutines / run

Module was compiled with an incom patible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.0

My app compiles, but after looking into a few related questions like (Module Error "Module was compiled with an incompatible version of Kotlin. The binary versi

An alternative solution to set negative padding values in Jetpack Compose? (java.lang.IllegalArgumentException: Padding must be non-negative)

I'm trying to assign a negative value to the padding modifier but the app had crashed. Have a look at my code. Thanks if you can help or give me an alternative

How to show Toast Message with Binding Adapter

I dont see Toast Messages. I want to show a toast messagges when click userAddFavoriteButton.. @BindingAdapter("addFavorite") fun bindAddFavorite(userAddFavorit

My MutableStateFlow doesnt emit when called from suspend function in test

I am trying to write tests for my Repository which provides access to my Room database. For this, I wrote a Mock Database and a mock DAO: My Database: abstract

Dagger - Hilt : Do we need to mark all activities with @AndroidEntryPoint

So my question is as I am getting started with Hilt, do we need to mark all activities with @AndroidEntryPoint annotation or can we just create a BaseActivity a

Kotlin Bundle send null values

I try to send values of my data from one fragment which is contains Instruments to HolderList which is contain Holder data for comparing values in ArrayList of

Change request body in ServerHttpRequestDecorator using AbstractGatewayFilterFactory - Webflux

Spring Boot Version: 2.5.1, Spring Cloud Version: 2020.0.3 Hello guys !!! I need your help ... My question is that I can't modify the request body in spring gat

Speech to text api - use morethen 1min audio using rest api show error

When i select audio morethen 30sec or 1min then its show below error --> Sync input too long. For audio longer than 1 min use LongRunningRecognize with a 'ur

Jetpack Compose Desktop switch to new window

Hey I'm pretty new to Kotlin and am trying my hand at a GUI as my first small project. For this I am using Jetpack Compose Desktop. I have already written a fir

Android Studio strings.xml: 'NBSP' suddenly appeared in my strings.xml files

I suddenly have the mention 'NBSP' in my strings.xml files, just before special characters (!, ?, ....) These 'NBSP' do not appear in my app when I run it. Als

Issue centering a QR square

I am writing an Android test app to see how to handle QR codes. This is the code for the main activity (MainActivity.kt) and a question is following. package me

Why using val instead of var in Kotlin? [duplicate]

I have seen some tutorials that recommend using val instead of var in Kotlin. I beleive val is like constant in Java right? Then how can we ch