Category "kotlin"

What's difference between "= remember" and " by remember" (Kotlin, Jetpack Compose)

I think two use case of remember exist. first one is @Composable fun abc() { var aa = remember { mutableStateOf(true) } } and second @Composable fun abc()

Dynamic list of custom items each with edit button. How to button binding?

I tried importing ObjLargeBinding, but idk what to do from there. Do I have to dynamically setOnClickListeners for each objective on screen? ''' import android.

How to resolve the error "LifecycleOwners must call register before they are STARTED"

I am using registerForActivityResult for google sign in implementation in my development. Everything was working fine until I upgraded my fragment dependency t

How to call custom uri using content provider kotlin

Basically what i want to call a SOS number using the android content provider from a smart watch. I have searched a lot but not able to find the correct path to

How to get error message in api call response in ktor

I am learning Ktor. I want to print error value or exception. I have taken some piece of code from this post. I don't understand this post answer fully. ApiResp

App/Scaffold white background changing issue in Jetpack Compose

Can anyone please point me out how to change this white background color of the app? Setting a color or background color on the Surface is having no impact. I'v

How to step through suspend function calls when debugging Kotlin coroutines

How is it possible to debug Kotlin code when stepping into or out of a "suspend" function? (see example below). fun mainFunction() = runBlocking { println

No activities found. Did you forget to launch the activity by calling getActivity() or startActivitySync or similar

When start my android app first start FirstActivity. When I click button on FirstActivity than start AddTraderActivity. If I press button "START REQUEST" in Add

Type 'State<List<User>?>' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate

I'm trying to get a value from LiveData with observeAsState in jetpack compose, but I get a weird error Type 'State<List?>' has no method 'getValue(Nothi

Why a new ViewModel is created in each Compose Navigation route?

I have a single activity app using only composables for the ui (one activity, no fragments). I use one viewmodel to keep data for the ui in two different screen

AsyncTask as kotlin coroutine

Typical use for AsyncTask: I want to run a task in another thread and after that task is done, I want to perform some operation in my UI thread, namely hiding a

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