Category "kotlin"

getStringExtra() not working in Adapter Class

I am trying to get the pass the current user data into the this adapter class. However, I failed to use the getStringExtra() where it keep mentions that the get

Get pixels of a recyclerView item

I'm wondering if it's possible to get the pixels of an item of a recyclerView, let's say I have an horizontal recyclerView and all the items are the same size (

Floating button doesn't seen because of Bottom Nav

On Main activity XML I have one buttom nav and on another fragment I have a floating button. This button is not visible because of the buttom nav. If I add on f

Mocking methods that call JNI with Mockk

I am trying to add unit tests to an existing Android app that has some JNI libraries (only for ARM). I am using Mockk and Junit4, and I have the following: This

Take a class as a parameter which has a particular method in it

I know that we can pass a class in a param which has a particular class as its super. For example, see this: public void sampleMethod(Class<? super MyParentC

Get tree of ancestors from a SQLite table with Room and Flows

This is very tricky for me because I don't know if it can be done with a SQLite query or by recursively calling some function. It gets complicated because I als

Change Spinner Text content programmatically

I have a spinner, and I want to find a way to change the dropdown for my spinner. I want to change my text content through code, but I'm not sure how to do that

Cannot reassign variable inside observer viewmodel

So I created MVVM app in kotlin to fetch movies from TMDB api, using injections and coroutines. My problem is that I cannot copy the list of returned movies int

How to use kotlin flow flatMap in Android

In my application I want flatMap operators such as flatMapMerge. But after write codes show me highlight on flatMapMerge and say add one annotation!I write belo

How do I upload image file to google drive from android

I'm having a issue uploading a file to Google Drive. W/System.err: java.io.FileNotFoundException: /storage/emulated/0/Android/data/dev/files/backup/https:/i.pic

Jetpack compose how to blur text area and line it to the bottom of a card

I want to place text at the bottom of a card and blur the text area with a translucent color. This is what I have so far. The design I am trying to achieve is t

How can we fetch the Firebase realtime database to List

Here I am Trying to Display "users" into Recycleview and I need to Get Data Into List databaseReference?.addValueEventListener(object : ValueEventListener {

How can i achieve this viewpager animation using pagetransformer?

PREVIEW i have been trying to create this kind of viewpager animation couldn't grasp how the animation works and always mess up. Would be really helpful if som

Compose: Why does a list initiated with "remember" trigger differently to Snapshot

I've been messing around with Jetpack Compose and currently looking at different ways of creating/managing/updating State. The full code I'm referencing is on m

Android appcompat edittext input automatically changes to selected language text problem

Hi Every One I am facing rare problem in an android app currently I am working on. Whenever my app has changed to different language except from english.EditTex

Jetpack compose scrollable table

I need to have a component that scrolls vertically and horizontally. Here is what I did so far: @Composable fun Screen() { val scope = rememberCoroutineScop

How Kotlin's coroutine is cancelled under the hood?

Suppose we have a CoroutineScope and we launched several coroutines from it via launch. Then we do CoroutineScope.cancel(). And then we need to wait until cance

[Android][MenuItem]How to display title text when long press actionLayout?

I'm using MenuItem in my tool bar and some of the items require custom layouts, so I created actionLayout for them. The UI looks fine, but when I long press the

setOnClickListener is not showing the Toast or doing the Intent

this is in Kotlin, it doesn't seem to work no matter what I try it's just a button with a click listener. Its function is to take me to another activity, I trie

How to solve flutter Execution failed for task ':twitter_login:compileReleaseKotlin' error?

I am trying to build an apk from my flutter application. I am using the algolia native api and modified my FlutterActivity according to this official documentat