Category "kotlin"

How to call a element from Layout without use findViewId() in Kotlin?

I didn't know this was possible, but I was following an example and I see this piece of code: import kotlinx.android.synthetic.main.activity_main.* class MainA

CameraX doesn't save the pictures

I'm trying to use the example app from google codelabs to implement the camerax application, but i dont know, why it doesnt save the pictures correctly. private

Kotlin Data Class Property: Multiple types

In Kotlin, can a property of a data class have multiple types? For example: val CurrentValue: Double?|String or val CurrentValue: String|Array? I cannot find it

How to get Context in onViewCreated

I'm attempting to configure a RecyclerView adapter and I have a line of code val decorator = AppCompatResources.getDrawable(context, R.drawable.decorator) This

Many third party libraries not working with android studio bumblebee update

Recently I've updated my android studio to bumblebee. With this update, many of the libraries I've used in artic fox is not working. some of them is following:-

Room DB ANR Input dispatching timed out

I am doing a db get operation for my cart page which has multiple tables. I have mapper class which has all the relations with all the tables. I have used corou

CPU, RAM stress android

I have a task to compare the performance of Java and Kotlin programs. I would like to measure CPU memory and RAM usage. I read somewhere that a good idea for CP

Kotlin: Problem with List Filter by Multiple Conditions

I'm trying to match two lists to another. In one list are items of crypto trades, the other contains so called candlesticks, which represents a price of crypto

Could not compile build file, startup failed in android studio

1 Build File "C:\Users\Macking Crasher\Desktop\Nasmus\gl/1a.gradle Tanw: 19 Could not compile auslaste "C:users\Macking Crusher\Desktop\nashoploustd.greate'. st

When i click on multiple buttons, multiple audios start playing at the same time in android studio

When i click on multiple images of recyclerview then multiple audios start playing without stopping the previous one. It is getting irritating. I hope someone c

How to pass array list data to a fragment from main activity when using bottom navigation view and Android Navigation component?

I am trying to pass array list data to one of my fragments in the nav bar from main activity. Is there a simple way to implement this? Or should I use activity

Storing constants in Fragment's companion object - a memory leak?

My understanding of companion object in Kotlin is that they are analogous to static modifiers in Java. It's bad practice to store static fields in Activities an

How to get requests path with unresolved variables in Spring WebFlux

I'm trying to get the request's path with unresolved path variables in a WebFilter. I know in SpringBoot Servlet version it is possible to do this by getting re

NPE: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference

I've this basic app called Navigation that I was trying to make to understand some concepts where there are 2 activities MainActivity and ActivityB MainActivity

How to throw Custom exception in ktor

Hey I am working in ktor. I want to throw exception in ktor. I am reading this doc and this example. I want exception, responseCode and errorResponse with error

App Crashes when Room DB Entity Class object boolean value is changed to false

I have a Room DB setup in my app and it was working well until recently when the app started crashing. It happens that I have a boolean value as a field in the

Why @JsonIgnore annotation doesn't work during deserializing data?

I have a data https://gist.githubusercontent.com/iva-nova-e-katerina/fc1067e971c71a73a0b525a21b336694/raw/954477261bb5ac2f52cee07a8bc45a2a27de1a8c/data2.json a

How to match color attributes between theme and icon in Jetpack Compose?

I have a vector drawable which has two paths with different attributes referencing to different theme colors. And these attributes' values are being changed by

Stopping Exoplayer on swiping in viewPager

I am making a reels type app. I have made a ReelsFragment and ReelsAdapter. I have used View Pager 2 to swipe views vertically. I am using Exoplayer to play vid

Caused by android.app.ForegroundServiceStartNotAllowedException startForegroundService() not allowed due to mAllowStartForeground false

I have upgrade the Android SDK project 30 to 31. Also i am using the the Android Beacon Library for scanning the the iBeacon. Android 12 i am getting the frquen