Questions tagged [kotlin]

Kotlin is a cross-platform, statically typed, general-purpose high-level programming language with type inference. This tag is often used alongside additional tags for the different targets (JVM, JavaScript, native, etc.) and libraries/frameworks (Android, Spring, etc.) used by Kotlin developers, if the question relates specifically to those topics.

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

Back press does not close bottom sheet in Android 33 and above

I've encountered an issue with Jetpack Compose where the back press event doesn't close the bottom sheet on devices running Android 33 and above. Is there a way to override this behavior or implement ...
leomuko's user avatar
  • 11
0 votes
0 answers
9 views

Koin injected SnackBar not working on navigation

I'm using Koin to inject a SnackBar instance into an app. The problem i'm having is that it will does not show the text when the user navigates from the previous (login)fragment. However if the app is ...
jampez77's user avatar
  • 5,032
1 vote
0 answers
13 views

Android: Not receive event for UsbManager.ACTION_USB_DEVICE_DETACHED status

I'm currently facing an issue in my Android app related to USB device detachment. I have a screen (SetupPrinterActivity) that is supposed to open when a USB device is attached and detached. The ...
ankushlokhande's user avatar
0 votes
0 answers
20 views

Android (Kotlin): Change Background of an ImageButton in a function

Question: How can I declare the ImageButton public, like in Java: public class MainActivity extends AppCompatActivity { ImageButton b1; Problem: This code works as expected: override fun ...
Ralf Stehle's user avatar
0 votes
0 answers
13 views

TabLayout tabs text not displaying (Kotlin)

I don't have the text displayed in the TabLayout. But the invisible buttons seem to work. problem. I wrote the program based on this example (https://www.youtube.com/watch?v=x_2wJYbnw3g&list=...
shadowck's user avatar
0 votes
0 answers
26 views

When attempting to add Module this error message appears "Module was compiled using an incompatible version of Kotlin"

When I add august aar file (like below ) I am getting this error "Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6....
Mohammad Taqi's user avatar
0 votes
0 answers
20 views

RecyclerView: Initial Image Loading Issue on First Scroll, Resolved upon Returning to Position

I have created a view with two RecyclerViews and a ScrollView to prevent the RecyclerViews from moving up when the user clicks on an EditText. I have set the orientation for both recycler views as ...
Ayaz Muhammad's user avatar
-1 votes
1 answer
12 views

how to start vector animation in android studio by kotlin

i have some xml with vector drawings in android studio. I need some help. How to show them by animation on mainActivity in Android Studio by kotlin. hello_android.xml is the main animation file. ...
Eblo's user avatar
  • 1
0 votes
0 answers
18 views

How can I disable swipe next card without my control in this library?

I'm just using this cardStackView library to make app like tinder swipe. https://github.com/yuyakaido/CardStackView I just want to show Question dialog if user want to swipe right that means like ...
Ahmet Yılmaz's user avatar
0 votes
1 answer
39 views

Why does Log.d(TAG,"B1: Offers: Size:"+ it.size +" "+ it.forEach{a -> "My Office: "+ a.offerTags.toString()} ) return error result?

Log.d(TAG,"B0: Offers: Size:"+ it.size +" My: "+ it[0].offerTags.toString() ) return correct result. But why does Log.d(TAG,"B1: Offers: Size:"+ it.size +" "+ ...
HelloCW's user avatar
  • 1,013
0 votes
0 answers
28 views

Why is the getView of the Custom spinner called multiple times

Text "Check_getView" is called Multiple time I don`t understand So to fix the multiple calls, I restricted getDropDownView from notifyingDataSetChange multiple times. But getView still calls ...
osj0524's user avatar
0 votes
1 answer
35 views

"empty String" when parse json into model class in android with kotlin

I am Android developer, I am facing a problem while making an API call. I am receiving a huge amount of data, making an API call, and I get the API call success, I can see the JSON response in the ...
Urvish Stack's user avatar
0 votes
0 answers
4 views

Android Chromecast integration without mediaroutebutton

I am creating an app without appbar and toolbar, where i don't want to inflate the menu xml. I require the casting to integrate the app. So any help. Most using the menu inflation. Any help would be ...
SURYA N's user avatar
  • 301
1 vote
0 answers
22 views

No email arrived issue when I use javax.mail

I am making android app with kotlin. I want to send email with my gmail account so I used javax.mail package. And now I faced an issue to send gmail. following is full content of my Notify.kt file. ...
Shiro Ennosuke's user avatar
0 votes
0 answers
25 views

Multiple services type in Android targetSdkVersion 34

I have a service using 2 types mediaPlayback and microphone and declared like this in AndroidManifest: <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK&...
Nhien Nguyen's user avatar
0 votes
0 answers
14 views

How can I print an invoice directly without using a preview panel in [insert software/platform]?

i want to print pdf in invoice without preview panel i create a printing button but.. button onTap show preview panel ....i want to print without preview panel I have to create a print button in which ...
Anand Jakhar's user avatar
0 votes
0 answers
7 views

How to send messages on a scheduled basis in Netty?

I want to send messages per 10 seconds with Netty framework. Therefore, I use a IdleStateHandler to send heart beat msgs on a scheduled basis: class ClientHeartBeatHandler(readerIdleTime: Long, ...
timeislikewind's user avatar
0 votes
1 answer
23 views

How to reset app data in KMP Desktop App?

I'm used to become an Android Developer. Usually, I use "Clear Data" or "Clear Cache" in App Info to clear the data for my Android App (Usually to reset login, database, etc.) How ...
Raka M.A's user avatar
  • 129
0 votes
1 answer
23 views

Unable to find Room Database implementation in Kotlin

I am encountering an issue with Room Database in my Android Kotlin application. When attempting to run the application, I'm getting the following error: java.lang.RuntimeException: Unable to start ...
NPC 011235813213455's user avatar
0 votes
0 answers
34 views

Kotlin extensions for GraphQL

We are stuck using an old version of Netflix DGS for GraphQL. It lets us write a schema and generates Java classes. A query looks something like this: FooProjectionRoot() .bar() .baz() .parent() ...
fafl's user avatar
  • 7,252
0 votes
0 answers
11 views

Flutter Execution failed for task ':app:checkDebugDuplicateClasses' when using rtmp_broadcaster package

After adding rtmp_broadcaster package to flutter project I start getting error during build for android. Below is my error: What went wrong: Execution failed for task ':app:checkDebugDuplicateClasses'...
Ranjit Kumar Pandit's user avatar
0 votes
0 answers
13 views

Handle Realm in kmm

I don't know why app crashed try { viewModelScope.launch { realm.writeBlocking { copyToRealm(Item().apply { summary = "Do the laundry" ...
Michelle Raouf's user avatar
0 votes
0 answers
14 views

How can I use viewModel with parameters in test

"I have a viewmodel to which I inject parameters using Hilt. @HiltViewModel class ShoppingViewModel @Inject constructor( private val addIngredientUseCase: AddIngredientUseCase, private val ...
Martí Curto's user avatar
0 votes
0 answers
30 views

How do I display my logo while my ndroid app is loading

I am trying to display an image (logo) while and android app is loading. I have been trying for two days with your but am unable to get is to show. This is my main activity: package com.identykidz....
CharlieT's user avatar
  • 384
0 votes
2 answers
26 views

Android RecyclerView item reorder infinite loop issue

I'm having a RecyclerView with GridLayoutManager. I've implemented item reordering so user can reorder the items using ItemTouchHelper & SimpleCallback. But there is a problem of infinite loop ...
dev.tejasb's user avatar
0 votes
1 answer
8 views

Is it possible to Autowire a KSP generated class without writing any additional boilerplate?

I have an interface for creating Dto/Domain mappers using Konvert, which uses KSP. @Konverter interface SimpleNoteMapper { fun toDto(note: SimpleNote): SimpleNoteDto fun toDomain(note: ...
JustAnEuropean's user avatar
0 votes
0 answers
21 views

Changes to latest version kotlin but still. Error : Your project requires a newer version of the Kotlin Gradle plugin

I have changed the kotlin version to latest. But when running the flutter build apk command, there is .Your project requires a newer version of the Kotlin Gradle plugin. build.gradle source: ...
Fandy Ahmad Irianto's user avatar
0 votes
0 answers
27 views

How to restore previous state of the activity when jumping back on it from another activity?

I am working on a social media app where I am moving from profile fragment to edit profile activity using Intents and I want to come back to the previous state of the app as I had left in profile ...
Bishal Prasad's user avatar
0 votes
1 answer
26 views

Jetpack Compose not updating without LaunchedEffect of unrelated item

Please can someone throw any light on the problem that I have with Jetpack Compose and a ViewModel. I have a data class called ProductEntity. data class ProductEntity( var id: Int = 0, var ...
eggie's user avatar
  • 13
-1 votes
0 answers
28 views

'http://localhost:3000' has been blocked by CORS policy in ktor

i ve got some error when run this app web : Access to XMLHttpRequest at 'xxxxxxxxxxxx.com/auth/login' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight ...
M Dzafadhlan Muzakki's user avatar
0 votes
0 answers
20 views

How should I add the floating action button in my kotlin code

I am creating a project for my college navigation. I have 13 location points in a closed loop structure as I am working on a single floor (Sixth Floor). I'm taking two inputs from the user as current ...
Bhushan Savaratkar's user avatar
0 votes
1 answer
42 views

isErrorEnabled not working Kotlin Android Studio

saasHI, I am doing a tutorial of Authenticaton Login and Register, isErrorEnabled and it is not working for me could you please help? the tutorial 3rd video minute 13:00 https://www.youtube.com/watch?...
Gothman 11's user avatar
0 votes
0 answers
32 views

image is not displayed after taking a picture from the camera after selecting an image from the gallery

I just started learning android studio with jetpack compose then I encountered an error where when I take a picture from the camera the image does not appear unless I take a second time it appears. @...
Alfian's user avatar
  • 1
0 votes
0 answers
37 views

I have a kotlin String variable and I want to execute the string as Kotlin code

I am using jetpack Compose to make an android application and I want to create a function that takes a string as one of its parameters and execute it at a specific order for example in python we had ...
Mustafa Ameen's user avatar
0 votes
1 answer
23 views

how to remove white background during animation?

how to remove this background or change it to another? I tried adding activity.window.setBackgroundDrawableResource(R.color.black1) to MainActivity but it didn't help enter image description here ...
Надир Парилаев's user avatar
0 votes
1 answer
36 views

Kotlin, WebView: How to set my page of ERR_INTERNET_DISCONNECTED

When I shut down wifi at my mobile phone and I click to the some link in WebView, I see this error: ERR_INTERNET_DISCONNECTED How to set myself error page? I searched solution too many days but I don'...
djlj's user avatar
  • 61
0 votes
0 answers
14 views

Intermediate state of bottom sheet behavior in Android

I've implemented a BottomSheet in my application. I want an intermediate state between collapsed and expanded, located in the middle of screen. Behavior wanted : User slide up the bottom sheet. It ...
Captain Nemo's user avatar
0 votes
1 answer
38 views

Images are not showing in the Image_view

I am creating a project for my college navigation. I have 13 location points in a closed loop structure as I am working on a single floor (Sixth Floor). I'm taking two inputs from the user as current ...
Bhushan Savaratkar's user avatar
0 votes
0 answers
42 views

Why is my HashMap empty after adding a value?

I am writing a Minecraft plugin (Paper) in Kotlin, and am running into an issue with a HashMap I am using to store players. I have a class named FishMatch which has a property players which is a ...
SirArchibald's user avatar
0 votes
0 answers
22 views

How to use a SwitchPreference to create a setting for light/night mode

For my app I am using SharedPreferences to create a setting that allows the user to switch between light and dark theme when using it. My problem is every time I load up the app and turn on the ...
SRBeginnerDev's user avatar
0 votes
0 answers
18 views

Creating Duolingo like Widget , Android layout and accomodating screen sizes

Planning to create a widget just like Duolingo Streak Widget. But I am not able to properly create layout for the widget. I have some questions specifically. The duolingo widget has a fixed grid ...
Saneen K P's user avatar
0 votes
1 answer
20 views

how to get the actual position of a motion event for a system overlay button

When showing an application overlay button in android via display over other apps permission, I set a motion event listener to allow the user to drag the button around onscreen, but the position that ...
Droid Automations's user avatar
0 votes
0 answers
34 views

Logging in the PostgresSQL Java driver

I'm developing a Kotlin application that uses a PostgreSQL database via Exposed. I'm trying to debug an error and I would like to see what SQL is sent to the database. The driver docs says it uses ...
Jordi's user avatar
  • 2,143
0 votes
0 answers
15 views

Endpoint Data to AlertDialog - Kotlin

i'm trying to show through an AlertDialog element the terms and condition of usage for my application, this text is stored into an EndPoint, the connection is made in the ApiInterface.kt and looks ...
Gatubi's user avatar
  • 1
1 vote
0 answers
19 views

KTOR MultiPartFormDataContent request is very slow

I need to perform hundreds of thousands multipart requests per hour containing either Form elements or File elements. Each request has 2 parts and the total size of the request is around 30kb but may ...
Alexander Petrov's user avatar
0 votes
1 answer
17 views

Didn't find class "com.example.madproject.ChapiiApplication" on path: DexPathList

I am using the Hilt dependency in the project. For that we use a class which look like the following one: package com.example.madproject import android.app.Application import dagger.hilt.android....
Mr. Chapii's user avatar
1 vote
1 answer
17 views

ManifestPlaceholder val cannot be reassigned in defaultConfig

I am new to android development (as well as development in general) and wanted to make authentication using Auth0. So I am following this guide as well as this guide. Both of them tell that I need to ...
stoneface's user avatar
0 votes
2 answers
25 views

Activity doesn't save the value when i change the orientation

I try to write the programm tha generates random lognormal value with given mean and variance value. I wrote a program and i overrided the onSaveInstanceState function to save my value and then ...
Uladzislau Kaplan's user avatar
-1 votes
1 answer
30 views

Building executable Jar file with Gradle for Spring boot in Kotlin - No manifest file

I want to build an executable jar file for my spring boot project,i tried several options, none of them worked. I always get the result that java can't find the main class. i tried to create an ...
Saher Al-Sous's user avatar
0 votes
0 answers
18 views

getResource of external Maven library returns null on Android

In my Android app I am consuming an external library as JAR via Maven. This JAR ships some additional resources (JNI libs) which I want to access via ClassFromLibraryJar::class.java.getResource("&...
Danielku15's user avatar
  • 1,490

1
2 3 4 5
1864