Category "kotlin"

Is it possible in one Java file to mix Java code and Kotlin code

Android Studio 3.4.2 in build.gradle: buildscript { ext.kotlin_version = '1.3.41' repositories { google() jcenter() } d

Can´t put the background in white on jetpack compose

I'm making a Login page on Jetpack compose. I'm using themes with MaterialTheme. When I choose the background colour as white, it shows me a dark grey colour. I

MediaSessionCompat:Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent

I'm trying to update my application to Android SDK 31 but I'm having an issue with MediaSessionCompat. I have a MediaService that extends the MediaBrowserServic

Firestore Delete elements from a nested map kotlin

I have a collection, I want to delete 2 documents from this collection Paradas collection and delete it from the nested map too Nested map like in SQL, when yo

Is there any way to implement pagination in spring webflux and spring data reactive

I'm trying to understand reactive part of spring 5. I have created simple rest endpoint for finding all entities using spring web-flux and spring data reactive

Check if Android app is running on a Google test device?

I recently uploaded an app bundle to Internal App Sharing, and was surprised to see that on my backend, there were 7 new users of this new app version just a fe

kotlin kapt3 KaptBaseError: Error while annotation processing ::For Room Database

I am running into this strange issue in the Room database operation classes. There are lot of Annotations are used, starting from Database then Entity, DAO... N

Strange value comparison issue in Kotlin, "===" returns true but "==" returns false

I have encountered a very strange value comparison issue in Kotlin that I cannot explain, the following code prints false data class Foo ( val a: Byte ) fun

How to pass command line argument to Gradle Kotlin DSL

Here's an example from Groovy that represents exactly what I would like to achieve: Command line: ./gradlew jib -PmyArg=hello build.gradle.kts task myTask

Kotling :: Android :: java.lang.ClassCastException: java.lang.Class cannot be cast to androidx.lifecycle.ViewModel

I am getting an exception in the first line of the code below viewModel.homeLiveData.observe(this, Observer { list -> list?.let { mLis

UninitializedPropertyAccessException in Android Studio using Kotlin

I am a beginner making use of a Roomdatabase. Mostly using it to load in and pass items between tables using simple relationships. package com.example.allin

Room database onConflict = OnConflictStrategy.REPLACE not working

I am working on Room database and trying to insert list of items(eg. list of Quotes which contains author name and a quote in my case). Following is the code I

How to pause a video in inside the webview in android

I am doing a task where i have to load the url inside the webview so that i can show the video,everything is works fine but the thing is i need to pause the vi

Gradle problems of adding koin test dependencies

I'm a beginner with gradle and would like to use koin in my Kotlin project. However, I get the following error Execution failed for task ':compileTestKotlin'. &

kotlin const val Const 'val' are only allowed on top level or in objects

In my Kotlin project I want to declare constant on compile time: So I use this: @RunWith(AndroidJUnit4::class) class TradersActivityTest { private latein

Is there a way to use the default value on a non-optional parameter when null is passed?

For example, if I have the following data class: data class Data( val name: String = "", val number: Long = 0 ) And functions that can return null:

Cause: androidx.navigation.safeargs can only be used with an androidx project

I am facing issue with navigation component called safeargs. I have used classpath 'androidx.navigation:navigation-safe-args-gradle-plugin:2.0.0' in build grad

Correctly implementing wait and notify in Kotlin

According to this document, using wait and notify is discouraged in Kotlin: https://kotlinlang.org/docs/reference/java-interop.html wait()/notify() Eff

IntelliJ Error:Kotlin: Module was compiled

I have used IntelliJ IDE just for Spring Boot project. Strong NOTE that I have not used any Kotlin project. But, today, I have an error below. Any professional

android studio cannot resolve symbol 'GradleException'

Creating new Android Studio project get the following exception in Gradle build file: Cannot resolve symbol 'GradleException' Gradle still builds successfu