Category "kotlin"

How to set the google in-app comment optional?

The in-app dialog is working fine on my device but it's has required comment. the submit button will not be enable if the user does not have inputted a comment.

The AsyncTask API is deprecated in Android 11. What are the alternatives?

Google is deprecating Android AsyncTask API in Android 11 and suggesting to use java.util.concurrent instead. you can check out the commit here * * @deprecate

How to run the Gradle kotlin-dsl plugin in an offline environment?

Because of reasons, the machine I'm developing on, is not connected to the internet. I have a local copy of all dependencies for the app and the build script. I

I'm getting a "Error inflating class com.google.android.material.navigation.NavigationView"

I have looked at other posts to this problem and I can't seem to solve it, so I'm hoping that its just a case that I am missing something obvious. Here is my c

How do I use Java's bitwise operators in Kotlin?

Java has binary-or | and binary-and & operators: int a = 5 | 10; int b = 5 & 10; They do not seem to work in Kotlin: val a = 5 | 10; val b = 5 &

How to send parameters for get request using retrofit and kotlin Coroutines.?

I was following the tutorial from https://proandroiddev.com/suspend-what-youre-doing-retrofit-has-now-coroutines-support-c65bd09ba067. I am having difficulty t

MockK "io.mockk.MockKException: no answer found for:" error

Hi i am trying to mock the response i get from a Single observable that gets returned from retrofit using a delegator that my presenter class calls and i am get

How to show most used item in first place in RecyclerView in Android?

I have made the application of different tools which have more than 60 tools I want that the user most used item showed in first place in RecyclerView. Please h

how to make full screen activity with status bar on top of it while scrollbar is not scrolling full in Activity when it focus on editText?

Issue is that when I enter text in EditText then ScrollView does not work and does not scroll in my activity fun statusBarColor(activity: Activity) {

how to make full screen activity with status bar on top of it while scrollbar is not scrolling full in Activity when it focus on editText?

Issue is that when I enter text in EditText then ScrollView does not work and does not scroll in my activity fun statusBarColor(activity: Activity) {

Property must be initialized or be abstract

How to declare class field? Like we can have it in java: protected SharedPreferences mSharedPreferences; And later in onCreate(): mSharedPreferences = Preferen

MapStruct not autowiring with Kotlin and Spring Boot, built using Gradle

I have the following parts in my gradle file: apply plugin: 'kotlin-kapt' ... compile("org.mapstruct:mapstruct:1.3.0.Final") kapt("org.mapstruct:mapstr

IllegalStateException: Default FirebaseApp is not initialized in this process. Make sure to call FirebaseApp.initializeApp(Context) first

I've been getting this fatal error today after changing some gradle dependences. Even though I tried to revert the gradle dependences back to the original I'm s

SetChecked() does not work

Hey guys on my Adapter ViewHolder.bind I have to check if some value is true, then check my checkbox. The problem is I cant use setCheck(tru) cause in kotlin do

Activity result contracts with Ucrop: cannot get crop result into app

I have an activity that is supposed to get an image from gallery and preview it before allowing the user to upload it to a database. I am using UCrop as my imag

How to use lombok with Kapt3

When I try to run Java/Kotlin android application with Lombok while using Kapt3: apply plugin: 'kotlin-kapt' javac compilation fails with numerous error: ca

Error:Execution failed for task ':app:kaptDebugKotlin'

I'm new to using Kotlin and trying to set it up with Dagger2, I've seen some few examples but none of them seem to work for me. I keep getting this Error:

Is there an elegant way to save and restore View state in Kotlin?

Writting custom views that keep their state across configuration changes in Android is verbose, look at the amount of boilerplate code for saving the state of

How to show error message in OutlinedTextField in Jetpack Compose

I need to show error message in OutlinedTextField and I don't find any documentation about how to do it. I found several ways in tutorials, for example to creat

How to show error message in OutlinedTextField in Jetpack Compose

I need to show error message in OutlinedTextField and I don't find any documentation about how to do it. I found several ways in tutorials, for example to creat