Category "kotlin"

mutation attempt of frozen io.ktor.client.request.HttpRequestPipeline@151ac8

I'm using IO Ktor: ktor client core to implement multi platform network requests, but I encountered some problems When I use the class attribute created by http

Share Button In Compose

How can I make a share button in compose, which will share a download link, I tried this but the result was different that I expected. Here is the code. Button

How to implement inheritance for a Room entity (Android, Kotlin)

I'm new to Room and haven't find any posts related to this. I have two classes: BaseModel and ChildModel. ChildModel is a Room entity class, but BaseModel - isn

How to implement inheritance for a Room entity (Android, Kotlin)

I'm new to Room and haven't find any posts related to this. I have two classes: BaseModel and ChildModel. ChildModel is a Room entity class, but BaseModel - isn

How to implement timer with Kotlin coroutines

I want to implement timer using Kotlin coroutines, something similar to this implemented with RxJava: Flowable.interval(0, 5, TimeUnit.SECONDS)

Android Studio, "Unresolved Reference: activity_main"

I am following this tutorial and cannot figure out how to resolve the errors "Unresolved Reference: activity_main" and "Unresolved Reference: app_name". The tut

How to hide actionbar in Activity, but show in fragment

i have a fragment from an activity, i hide the actionbar in my activity like so supportActionBar?.hide() in the onCreate function of the activity when the app

Currently doing the fragments and navigation pathway of the android kotlin course and having some troubles with the letter list fragment

When I populate the nav_graph.xml with the two fragments the words fragment displays fine but the letters fragment just displays a default item list of 1 to 9.

How to set a new audio data source for Android MediaPlayer in Kotlin

New to Android and Kotlin... I am trying to set a new audio data source for the Android MediaPlayer. The below code compiles and runs, but the sound isn't playe

How to POST Object Array with Retrofit?

I send the data from the postman like this: {"contacts":[ { "idContact": "201", "name": "Joseph", "lastName": "Herrera",

How to use .svg file in Jetpack Compose for Desktop?

I am trying to use a .svg (vector file) to show an image but I am stuck and not able to do it. Is there any way I can use it, I tried to use it like this Image(

What is the proper way to navigate from ViewModel in Jetpack Compose + Hilt + ViewModel?

I have stumbled upon this quite trivial, but tricky problem. I have spent a decent amount of time searching official docs, but unfortunately found no answer. Of

Is there a way to auto-cast string to enum?

Is there a way to auto-cast or auto-convert strings to enums? playground enum class Direction { north, south, west, east } fun main() { val d: Directio

Kotlin methods accepting inline classes as parameters - how access from Java?

Let's say I have: inline class Email(value: String) and fun something(email: Email) now if I want to call something() from Java I can't. Because any method

Execution failed for task ':app:mapDebugSourceSetPaths'. > Error while evaluating property 'extraGeneratedResDir' of task

I've checked this answer: https://stackoverflow.com/a/34834772/13519865 It tells us to remove this line apply plugin: 'com.google.gms.google-services' Removing

Sending Data in Body in retrofit kotlin

I am using retrofit for calling the API i have to send the data in Body as we send in Java @Body but don't know how to parse the data... { "appType": "EXTERN

Add 2 or more constructors in kotlin

how to add 2 or more constructors ?? i know the use of data class in kotlin, but i am not getting what exactly this keyword is in kotlin and why we have to put

Flow message not delivered in unit test

I have a consumer that reads messages off MutableSharedFlow (which acts as an EventBus in my application). I am trying to write a unit test to show that passing

moving from fragment to bottomNavitem, Onclick of that bottomNavitem, it opens that fragment again i need to open start fragment again,without delay?

i tried to open bottomNavitem from fragment with this code on ,it opens bottomnavitem ,on comming back same bottomnavitem it open same fragement while i need to

Suspend function 'callGetApi' should be called only from a coroutine or another suspend function

I am calling suspended function from onCreate(...) override fun onCreate(savedInstanceState: Bundle?) { ... ... callGetApi() } and the suspended