Category "kotlin"

android camera2 Api autoflash not working properly, the first picture is taken before the flash fires

I'm using camera 2 API, my project is heavily based on the archived project from google: https://github.com/googlearchive/android-Camera2Basic/ I'm starting the

Jetpack Compose take screenshot of composable function?

I want to take screenshot of specific composable function on Jetpack Compose. How can I do this? Please, anyone help me. I want to take screenshot of composable

How to Unsubscribe from coroutine flows right after RoomDb call

I'm trying to query Room database(action 1) and then based on the returned results perform another action on the same table. however I noticed that every time I

Cancel viewModelScope and re-use it later on

I'm using Coroutines for dealing with async jobs: viewModelScope.launch { val userResponse = getUsers() //suspendable function } What I want to do is stop

Kotlin Android Studio: org.junit.ComparisonFailure with NBSP

I have this code @Test fun price_twelve_cupcakes() { val viewModel = OrderViewModel() viewModel.setQuantity(12) viewModel.price.observeForever {}

Downloadable Font's font weight not working android

I was following this official guide and wanted to use Poppins font for my project. The font has changed but the font weight property does not seem to be work. I

How to remove padding between AlertDialog and title/text with Compose

Using compose, I want to create something like this : Problem is using compose AlertDialog I only achieve to get this : There is a padding between the AlertDi

How to remove padding between AlertDialog and title/text with Compose

Using compose, I want to create something like this : Problem is using compose AlertDialog I only achieve to get this : There is a padding between the AlertDi

What is the better or easier way to create "nested" menus in Jetpack Compose?

So in XML you were able to structure menu items and nest them like this. But in jetpack compose, I am unable to figure out how this would work. I already read

How to call suspend function from Service Android?

How to provide scope or how to call suspend function from Service Android? Usually, activity or viewmodel provides us the scope, from where we can launch suspen

RealmDB and diacritical letters problem with upper and lower case

I have project where I use RealmDB. When I use search feature with normal string(letters) it work well - upper/lower letters are in mode Case.INSENSITIVE, but i

How to update the recyclerview when opening the app?

I'm looking for a list of movies in an API, the project is in MVVM and the search is being done perfectly. However, when opening the app, the user has to exit a

Kotlin read from room database in fragment

I write an application with room database and I have a problem with reading data and use it in the mine thread. consider tables as those: Table1 | ID | Name |

Kotlin Flows map

I have an issue regarding kotlin flow merging. See below fun. suspend fun method(filter: String): Flow<List<Model>> { // Search. val models: List&l

Android Databinding Cannot find a setter for * that accepts parameter type *

Am trying to declare a variable in databinding layout it's type is array of integer but I getting an error when building the project Cannot find a setter for &

Getter for defaultDisplay: Display!' is deprecated. Deprecated in Java

I need the width of the screen. But recently found Android defaultDisplay deprecacted with message: Getter for defaultDisplay: Display!' is deprecated. Deprecat

Can we integrate POLQA (perceptual objective listening quality assessment), to Check Voice Quality of Call?

I have requirement to Check Voice quality Rate out of 5 , 5 indicate excellent and 1 is bad. i have research POLQA can do it. but can not find any reference for

sentry android install error Failed to resolve: androidx.lifecycle:lifecycle-common-java8:2.4.0

i want to add sentry 5.6.0 to my android project but always give error on gradle build buildscript { repositories { mavenCentral() } } plugins

After fixing "Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8" Android studio emulator still doesn't work

I got an error "Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8" I change it in IDE settings and JAVA_HOME environment variabl

How to trigger other CardView element in recyclerview than clicked?

I have a method in adapter using recyclerview I basically display some elements of cardViews. How to trigger method on other element where usually I use cardVie