Category "kotlin"

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

Save data to local storage using Room

I apologize in advance if the question seems incomprehensible, since android development and kotlin are not my main stack. I will try to explain in as clear a l

Kotlin Flow - Some emitted events not received when collect

I am using MutableStateFlow. My flow type is sealed class with different states (Loading, Success, Error, etc). Initial value of my flow is empty: private val _

getSystemService NullPointerException

package com.example.myapplication import android.app.Activity import android.content.Context import android.os.* import android.util.Log import android.vie

Screen recorder app not detecting my screen size (width and height)

Source: here With the following segment of code all my Android devices record with a maximum width of 960 rather than the device width. val metrics = resour

After a coroutine scope is cancel, can it still be used again?

When we have a coroutine scope, when it is canceled, can it be used again? e.g. for the below, when I have scope.cancel, the scope.launch no longer work @Te