Category "kotlin"

Android Studio Kotlin app "keeps stopping" when I run it

I am just trying to set up a spinner configured as a dropdown menu, but I can't even test my app to see if it works because every time I run it, it immediately

What causes java.lang.VerifyError: Verifier rejected class?

While uing Moshi converter, adding a few more, causes the following error. Not sure where or why it says Rejecting invocation, expected 81 argument registers,

How can i make actionbar not overlap layout on a specific device

actionbar overlaping the layout on pixel 2 it goes under but on pixel 4 it don't. If i add padding in the xml file it fixes the problem on pixel 2 but its gonna

Is it possible to send Uri using AIDL?

I have two apps, lets say AppClient and AppService. Those apps are communicating between each other using AIDL methods. Right now I would like to send Uri from

Getting the ProductDetails price in android-billing-5.0

I have upgraded my Kotlin app to android-billing 5.0 from 4.0, and as such, SkuDetails is now deprecated so I am migrating to using ProductDetails using the mig

Thread.currentThread() performance

I have Runnable queue that invokes one by one in specified thread. val queue = LinkedBlockingQueue<() -> Unit>() val queueThread = thread { while(tr

What is the best Compose way to build preference screens without using a fragment?

I was unable to find any documentation on how to create preference screens in a pure Compose way without using a fragment. Can anyone please suggest the best wa

Jetpack compose dialogFragment equivalent

I'm trying to implement a dialogFragment with custom layout in Jetpack compose but can't find any samples. Do I need to wrap the UI components inside a Card/Sur

On Complete on Normal function in Kotlin

I have a Piece of code I want to execute just after the completing the first function doc_ViewModel.encryption(img,txt,uid!!) The above is just a rando

My android app keeps crashing from which seems to be a permission problem despite granting the relevant permission in the Manifest

Below is the MainActivity code from which the problem is arising from. class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListene

Change switch color programmatically in Android Studio using Kotlin

I am trying to add a color to the switches in Android Studio using Kotlin I tried few answers fronm this forum and couldn't get it to work Is it possible to mak

Project Structure in Android

I am new to Android programming and wanted to know about the project structure. I wanted to test my app on an Emulator but somehow I could see the three Java mo

Why Spring @Autowired doesn't work in abstract class?

I am doing this way in abstract class @Autowired lateinit var fileContract: FileContract with error kotlin.UninitializedPropertyAccessException: lateinit prop

How to remove padding from Text button?

I am trying to remove padding from TextButton but it wont work. TextButton( onClick = {}, modifier = Modifier.padding(0.dp) ) { Text( " ${ge

Saving State with Bottom Navigation View

I'm currently writing an app that displays a list of movies. I'm using a bottom navigation view with 3 tabs: Trending, Discover, and Favorites. Each of these di

Android: Automatically modify metadata of any new file(s) saved or downloaded

Is there a way to attach a piece of custom code to the Android OS which automatically deletes all the metadata of any new file(s) saved or downloaded (e.x. owne

How to not count a swipe for a press in kotlin android studio

I'm building a game that when the user pressed in to first activity title screen it starts the game but I don't want to count a swipe as a click because the use

best way to compare images for similarity in android

how to compare two images, to know are they similar for 100%? I was getting path of all images from mediastore, then converted to bitmap and compared using bitm

Time Format String

I am trying to decode the date-time receiving from my APIs in my required format "yyyy-MM-dd" I receive time in 2 format 1. "2022-05-05T11:32:12.542Z" 2. "2022-

context.createDatabase is not finding in preferences DataStore Android

I've just implemented Preferences by Android DataStore but I can't find "context.createDataStore" I added this dependency below implementation "androidx.datas