Category "kotlin"

RecyclerView sorting process and getting position issue

I have an activity that shows model comes from Firebase in a recyclerView. Each row has a delete button and user can delete which row he/she wants. The problem

How to show and save contact name in Android Fragment

I am a newcomer to Android development and Kotlin. I encounter a problem when I read a Android programming book. The book uses startActivityForResult() and onAc

ForgeGradle actions causing IntelliJ to crash

The gradle process fails when I tried to build or sync my Forge mod written in Kotlin with IntelliJ The way to find any output is from the logs: [ 34623] WAR

I am trying to make a smart contract transaction. My transactions never gets mined

I have a smart contract deployed. Whenever I try to perform a transaction, the transaction starts, but that's it. The transaction never actually takes place (or

Order ArrayList with Int and String in Kotlin

I have the given array val things = arrayOf<Any>("Jack", 8, 2, 6, "King", 5, 3, "Queen", "Jack"); Below is the code I have used things.set(things.indexO

How to return multimap type with 3 tables (Android Room Databases)

I am trying to do a 3 way JOIN in my query for my Android Room Database. My tables relationships are: Table1 has a 1 to 1 relationship with Table2 Table2 has a

Combining Two Flows and add them to temporary list of StateFlow(Hot Flows)

I m getting data from two End points using flows and assigning those two list to temporary list in ViewModel. For this purpose, I'm using combine function and r

Room Database returns updated value only after app restart

i am inserting and deleting a row in room database using following methods of ViewModel class fun insert(rules: TableRules) = viewModelScope.launch { reposi

I am using viewpager2 inside a recyclerview but the images are not outputting. Why?

No matter what I do the pictures are not showing up. Even if I set the items to match parent, I still have the same problem, I've been dealing with it since the

How to use Kotlin generics to access same fields in sibling classes

data class Type1(val str: String) data class Type2(val str: String) interface Person data class Child1(val name: Type1) : Person data class Child2(val name: T

AES encryption of Image In Kotlin

I am trying to encrypt and decrypt the image by AES in Kotlin Key Generation Function- override suspend fun key_genration(callback: Enc) { val keygenerator

How to separate large numbers with spaces kotlin

I have a calculator app and I want it to show large numbers with spaces between them when users enter their input. Currently, they don't have spaces between the

4003: Data item to large sending data from wear os to app

I'm developing a wear os app that needs to send a list of "MyObject" to mobile, data class MyObject( val id: String, val name: String, val locations

How can I zoom in of an image without enlargining it?

I've been looking at a few methods of zooming in on images and I've found some similiar versions of this Zoom in GeeksForGeeks. Now my question is whether the z

Filter in calendarView

How can I filter the list to the selected date of the calendarView My error in in line *emit(it) private fun getFilmsDbFlow(resultDb: ResultDb): Flow<Results

Switch between activities but global function

I want to create a global function and I want to switch between activities with this function. Extensions.kt fun goActivity(context: Context, goClass: Class

Spring's @DateTimeFormat ignores wanted date format pattern

Can't get my head on how date formatting using @DateTimeFormat works. I send query with date params being: dateCreateFrom - 01.04.2022T00%3A00%3A00 dateCreateTo

kotlin quiz i can't color answer because don't run ContextCompat

Could you help me with the following code, I can't get it to paint the correct option green, or show the animation, of the CorrectResponse function. If I delete

Uneable to find TransformToGrayscaleOp class in android for transform to greyscale in android

I want to transform my image to grayscale but when i traid to use TransformToGrayscaleOp class i got this error in the ide: Unresolved reference: TransformToGra

Notifications are not shown when the app is closed, how can I fix it?

It successfully shows notifications when the app is open. It shows even when the app is in the background. When I close the app it doesn't show up anymore. I do