Category "kotlin"

Set Drawable instance to Image in Jetpack Compose

In Jetpack Compose, who can tell me is there a way to assign a Drawable Object to the Image compose view? I took the apps installed on an Android device. I get

Jetpack Compose - Column - Gravity center

I'm creating a layout with Jetpack Compose and there is a column. I would like center items inside this column: Column(modifier = ExpandedWidth) { Tex

Is 'constructor LocationRequest()' deprecated in google maps v2?

I stumbled upon this message recently, and I was pretty sure that this constructor wasn't deprecated in prior versions to 18.0.0, but I cannot find information

java.lang.NullPointerException: DataBindingUtil.setConte….layout.activity_chapter) must not be null

I have just build a project with android kotlin but when I run the app it got crash, and in the logcat I found this error java.lang.NullPointerException: DataB

Kotlin: Equivalent of property wrappers from Swift

What is the equivalent property wrappers for Kotlin: @propertyWrapper struct Foo { var wrappedValue: String { get { return "Test

Custom parameter names with a bean for request parameters in Spring 5

I'm trying to use Spring 5 to have a custom bean for my request parameters. In theory this is easy, but I want to have the field names be different from the par

How can I convert a Long value to date time and convert current time to Long kotlin?

The Code A can convert a long value to date value, just like 2018.01.10 I hope to get Date + Time value , such as 2018.01.10 23:11, how can I do with Kotlin?

Fragment navigation and menu. How to remove latest fragment? Check description

I was incapable of finding an answer for the following context: Let's say we have a menu and a nav graph instanced in the main activity. We have 3 fragment: Hom

How to inject data class in android with dagger where data class parameter have no default value?

My data class like: data class Animal(var id:Int = 2) { } My Provides method in module class like: @Provides @Singleton fun provide():

Kotlin Multiplatform Project Unit Test Issue

Today I just updated my Android Studio to Android Studio 3.5.2 Build #AI-191.8026.42.35.5977832, built on October 31, 2019 JRE: 1.8.0_202-release-1483-b49-5587

Firestore returns empty list [duplicate]

I have 3 entries in my firestore database. I need to query the data and fetch it, then input it into an ArrayList. The problem is my query is

Cannot access 'java.lang.Object' which is a supertype of... Check your module classpath for missing or conflicting dependencies

I thought it would be fun and informative to learn more about static code analysis by implementing my own custom linter. I've been trying to declare the below d

Why use Arrow's Options instead of Kotlin nullable

I was having a look at the Arrow library found here. Why would ever want to use an Option type instead of Kotlin's built in nullables?

Filtering a recyclerview list using map or switchmap

I've been trying to figure this out for 2 days now - I just can't seem to get it to work! I'm using MVVM with a Repository pattern. Could someone tell me what I

Error receiving broadcast Intent when using SmsRetriever

When authenticating using Firebase Auth, I want to auto input the code that is received via SMS. I am able to receive SMS and go through auth process manually,

Adding function to foreground service lifecycle methods can create an issue? Is this best practise?

I created a timer app. So it's counting time basically and I'm saving the time to room when service close in OnDestroy scope. Is it best practise? Or is there a

How to Pass a List of Objects from activity A to activity B in Kotlin?

I have 2 Activities, I want to pass an arraylist of an Object and show it on a ListView Activity A: btnGuardar.setOnClickListener{ i

Compile the Kotlin android file through the command line compiler, show unresolved reference: synthetic

I used kotlin-android-extensions the kotlin code is simple import android.os.Bundle import android.widget.TextView import android.widget.Toast import kotlinx.an

Get Currency symbol of only one character (e.g $,₹, etc) (Locale doesn't matter) android kotlin

i have currency code (e.g. USD,INR,etc...). I want to get symbols of only one letter of those codes (e.g $,₹, etc). i have tried to find many solutions li

E/FirebaseInstanceId: Token retrieval failed: AUTHENTICATION_FAILED - what changed?

I'm not sure what's going on here, I pulled my recently updated repo and every time I open the app to debug it on an emulator I get E/FirebaseInstanceId: Token