Category "kotlin"

Kotlin Multiplaform iOS Exceptions showing in Xcode, not in Firebase

We have noticed in our project, we are getting allot of exceptions logged in Xcode (->Organiser->Crashes) logged in production... However these Share cra

Issue with backstack and bottomnav in kotlin

I have a bottom nav with 4 fragments Home, Following, Notification, and Profile, there is no issue with the bottom navigation on backstack , but now for eg from

Do I need to mention the coroutine dispatcher while working with Retrofit and Room?

Recently I saw this - Most data sources already provide main-safe APIs like the suspend method calls provided by Room or Retrofit. Your repository can take adva

Know whether a view is completely visible in a recycler view from its adapter

I saw a lot of posts that show the currently entirely visible item in the recycler view but, from the activity. But, I want to know about that from the adapter.

Upgrading Android kotlin version to 1.5.0 throwing error message on build

Running with kotlin version '1.4.32' my Android project runs and builds. Trying to upgrade to kotlin '1.5.0' and my build throws: Execution failed for task ':a

How to run migrations on Android Studio?

Sometimes I see a pop-up, that I can migrate to a newer kotlin version or something but I recently accidentally closed it and after restarting Android Studio it

How to run migrations on Android Studio?

Sometimes I see a pop-up, that I can migrate to a newer kotlin version or something but I recently accidentally closed it and after restarting Android Studio it

Pdf file is not able to load in android webview but able to load in external browser

I have the webpage created with angular js file. There are pdf files inside the webpage we want to download and show. when clicking the pdf file, it just show l

Launching Fragment with Espresso displays layout with black overlay and grey actionbar

I wrote a simple espresso test in which I launch a fragment with the following code: package com.example.fragmentedittexttest2 import android.util.Log import a

App crashes using the new Android 12 Splash Screen API

I'm trying to use the new Android 12 Splash Screen API but my app keeps crashing when opening the first activity. I have MainActivity as my launcher activity wi

How to detect what the content on the display is?

I have an app that rotates other apps. It uses an accessibility service so I have the ability to retrieve screen content. Say I'm rotating a game called Geometr

How to safely (lifecycle aware) .collectAsState() a StateFlow?

I'm trying to follow the official guidelines to migrate from LiveData to Flow/StateFlow with Compose, as per these articles: A safer way to collect flows from A

in kotlin app, message listview not displaying emoji view

i have got emoji view in logcat of android studio. but not getting that emoji view in app. i have set emoji textview in layout but its not visible in listview.

Parallel processing values emitted by flow in Kotlin

Kotlin code runBlocking { flow { for (i in 0..4) { println("Emit $i") emit(i) }} .onEach { if (it%2 == 0) delay(20

How to save fragment state while navigating with navigation component

I'm trying to create a single activity app using android architecture components. I have a fragment A which has some textfields, when user pushes a button I nav

I am using a scroll view that hides my toolbar while scrolling, I don't want my toolbar to hide while scrolling

I am making a register screen, that has a toolbar on top of it. When I scroll down the toolbar hides(goes up). I don't want my toolbar to scroll when I am scrol

Filtering array list

I have a class which I want to use, to filter my array according to driver. Driver is hardcoded just to try and eliminate possibilities of why the code is not w

What does "intrinsic" implementation mean in Kotlin?

When browsing through Kotlin source code, I found that in some places NotImplementedError is thrown: public suspend inline val coroutineContext: CoroutineContex

Completable.create of RXJava equivalent in Kotlin Coroutines- Android

I am working on Firebase authentication wherein I need to put the firebase auth on my Repository. I found this article on how to do it but it uses RxJava. (http

Android Kotlin: onTextChanged not being triggered for EditText

I am creating an EditText box with line numbers on the side. To achieve this, I have code in the onTextChanged method of the addTextChangedListener that updates