Category "kotlin"

AssertionFailure: null identifier when try to save identifying one-to-one relation

I'm trying to make identifying relation with Spring Data JPA. And following is my (simplified) entities. @Entity class AuthorizationCodeEntity( @MapsId

Kotlin Android View Binding: findViewById vs Butterknife vs Kotlin Android Extension

I'm trying to figure out the best way to do Android View Binding in Kotlin. It seems like there are a few of options out there: findViewById val button: Butto

How to display title and snippet on a google maps composable marker, without clicking on it?

I'm using the new google maps integration library with jetpack compose, however I want to modify a behavior of my markers: when the map initializes I want to sh

Room database reset to default values which was set by prepopulating database when clearing app from background

I have a database which is prepopulated with some tables which is working fine. I have prepopulated my db. like this Room.databaseBuilder( get(),

Global variable in Kotlin (android studio) initialized in one activity remains at initialized value in other activities

I would like to implement a global variable that updates its value when going from one activity to another (and back). To explain in better detail, let's say my

How to add smooth movement, relative positioning and animations to chat heads like views

I am using "Draw over other aps" to show a chat head like view. I need to position it relatively and show animation while dismissing it. Please see first video/

swift "completion: @escaping" in kotlin language. How to use callback in kotlin?

I am looking for a way of completion block for my kotlin code. In Swift i have my function: func fetchRegister(with request: RegisterRequest, completion: @es

Converting RecyclerView to ViewPager / PagerAdapter

Background - New to Android, but pretty nifty with moving layouts around, understanding Java, Kotlin and XML. However this task seems to be way above my head.

How to use Kotlin with a Bukkit/Spigot plugin and Gradle

I am trying to use Kotlin for a Spigot plugin (for version 1.8.8), as I find Kotlin a lot more efficient to use. But, whenever I try and run the plugin, I get t

How to make multiple constructors in Kotlin?

I want to use library which is in Java and it has alot of errors so I'm trying to change it to Kotlin. And AndroidStudio is not converting Java to Kotlin proper

How to preview an image and only saving it if the user accepts it using cameraX

I use cameraX api for taking a picture and save an image as a file to the internal memory. When the callback for taking a picture has succeeded, I update the ui

How to create a button in Kotlin that opens a new activity (Android Studio)?

Hello I'm making an app using Android Studio and the Kotlin language and am having trouble getting my button to open a new activity. I have the button created i

How can I add a footer to Kotlin Dokka docs?

I am looking for a way to include text in the footer of all Dokka generated docs. I am not seeing this option being advertised by the Gradle or Maven plugins fo

Is there any way to drop request inside plugin

Now I'm developing server application with ktor 2(2.0.0-eap-256). What I want to do is, according to header or other information, Reject or set adequate http st

Intellij gradle kotlin project generate .class files in both java and kotlin directory

I have a Gradle Kotlin project setup in Intellij, The source directory is as follows: src main kotlin resource test kotlin resource When I

How to read an environment variable in Kotlin?

I'd like to get a certain value from an environment variable in my Kotlin app, but I can't find anything about reading environment variables in the core librari

What is the difference between var and val in Kotlin?

What is the difference between var and val in Kotlin? I have gone through this link: KotlinLang: Properties and Fields As stated on this link: The full syntax

Select image from gallery using Kotlin

Recently i have started learning Kotlin. After having some basic functionality i am stuck with image picker. Does there any specific way to select an image fro

Retrofit2 post request is successful but I'm not able to retrieve token from response body

So I'm trying to making a login(post) request to an API (https://reqres.in/api/login) with retrofit 2. The connection was successful as the response code is 200

How can I save data from intent to text file to documents folder?

I am receiving an object that I want to save with timestamp to text file in the phone's documents folder. I have currently added the permissions lines to Androi