Skip to main content
The 2024 Developer Survey results are live! See the results

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.

0 votes
0 answers
13 views

Android compose `NotificationListenerService.onNotificationPosted` is never called

I'm trying to add a notification listener to a Kotlin android compose project: My AndroidManigest.xml: <application> <!-- ... --> <service android:name=&...
Valentin Vignal's user avatar
-1 votes
0 answers
10 views

Could not find gradle-8.3.1.jar (com.android.tools.build:gradle:8.3.1)

I want to create a new project I got this error: A problem occurred configuring root project 'My Application'. Could not resolve all files for configuration ':classpath'. Could not find gradle-8.3.1....
S.M_Emamian's user avatar
  • 17.3k
0 votes
0 answers
13 views

Crash on Destroy Method: "View ... does not have a NavController set"

I am getting a crash in the onDestroy method with the following error: `Fatal Exception: java.lang.RuntimeException: Unable to destroy activity {com..presentation.screens.main.MainActivity}: java.lang....
Gaurav Bajait's user avatar
0 votes
0 answers
17 views

make video full screen on click

i'm writing app using kotlin and i facing this problem i can't switch video player to full screen this is my xml file : <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android&...
Alucard's user avatar
0 votes
0 answers
7 views

Android websettings.setcachemode is globally?

I called clearCache in an Android WebView to delete the cache. However, I found out that this method works globally for the application’s WebView. clearCache Added in API level 1 public void ...
choi's user avatar
  • 1
2 votes
1 answer
22 views

Kotlin sealed class inheritance not working without casting to sealed class

I am trying to use sealed class inheritance to organize data in a recyclerview which consumes data through PagingData, and I have been able to make it work but there is situation that I could not ...
Shadow's user avatar
  • 4,574
0 votes
0 answers
8 views

Schema validation failed in Realm/Atlas due to an unknown type

I have a Kotlin Multiplatform app that I'm trying to get to work with Realm/Atlas. When I try to do a Realm.open(it) it says: IllegalStateException@29576} "java.lang.IllegalStateException: [...
user443654's user avatar
0 votes
1 answer
17 views

How to Pass ArrayList of Custom Objects Between Activities in Kotlin on Android Studio

I'm working on an Android project in Kotlin where I store user information in a custom object. I need to pass an ArrayList<CustomObject> from one activity to another and display the stored ...
Ahmad Louis's user avatar
-2 votes
0 answers
25 views

Linking of multiple apps [closed]

If we create an flutter application (Android + iOS) using visual studio code "we have 3 applications named A, B & C. A is the main app and the other two apps (B & C) are separate apps. i ...
DDeveloperDeep's user avatar
1 vote
2 answers
31 views

How to draw a hexagon with rounded corners on Android Canvas?

I want to make a hexagon with rounded corners, but I don't have any idea how to do it. I try it with different methods like: cubicTo, arcTo, etc. My code to draw this fun Path.customHexagon(radius: ...
xMaster's user avatar
  • 11
1 vote
1 answer
23 views

how do i observe changes made to kotlin's MutableList?

var questionPool: MutableList<String> = mutableListOf() questionPool contains string ids. ids are added and removed throughout the application's lifecycle. How can i execute a function foo ...
234's user avatar
  • 41
0 votes
1 answer
29 views

Using a str variable as a key for a map always returns null

I am trying to use a Map without success. I have whittled it down to a bare-bones case: I create a Map with four entries: ("fruit", 25) ("veg", 30) ("baked", 35) ("...
tbbrightman's user avatar
0 votes
1 answer
13 views

How to clear TextField upon first focus in Jetpack Compose

I am wondering if anyone has tried to modify the value of text in a TextField Component upon clicking into it the first time. I.e. There is example text, you click on it and the text disappears, with ...
Cory .D's user avatar
  • 71
0 votes
0 answers
8 views

Paginated Data, Should I keep it as state of the screen or only internal state to recycler view adapter?

How to manage paginated data in a StateFlow for a RecyclerView? Should I store only the last fetched page in the StateFlow and accumulate data in the adapter, or should I store the entire dataset in ...
itsTanany's user avatar
  • 457
0 votes
0 answers
28 views

How to prevent a SharedFlow collect values when the activity resumes?

I have found an issue where SharedFlow does not collect values when the activity is open. So I set replay = 1, which worked fine initially. However, I found that when the app is sent to the background ...
Tawanp's user avatar
  • 1
0 votes
0 answers
17 views

Put android lib .jar online (Github)

I have several .jar libraries in my project. I do not have access to the source code, only the .jar. I would like to make the implementation of these files available via github. At the moment: ...
Joao Victor Simonassi Farias's user avatar
0 votes
0 answers
11 views

Separating Music Files by USB Port on Android Tablet

I'm working on an Android project that involves playing music on a tablet. This tablet has multiple USB ports, and my goal is to read and display the music from each connected USB device separately, ...
Kalebe Estumano's user avatar
0 votes
0 answers
44 views

How can I estimate the difference in performance of a HashMap lookup vs List iteration in Kotlin?

I am working on an application that needs to map pdf documents to corresponding json data files (see: Kotlin data structure for efficient lookup of nested data for more details). In trying to ...
pbuchheit's user avatar
  • 1,663
0 votes
2 answers
19 views

How to change the value of a Textview present in another activity if value of Textview in my current Activity changes in Android?

So I have two activities named "MainActivity" and activity named "Second", so my MainActivity has it's own Adapter class named "PractiseAdapter". So my MainActivity ...
Freya19's user avatar
0 votes
0 answers
12 views

Spark doesn't recognize not null fields while reading from the source

I'm trying to read data from database and then save it to parquet file using Kotlin and Apache Spark. JDBC Driver I use: com.mysql.cj.jdbc.Driver val customerDf = spark .read() .jdbc( ...
anthis's user avatar
  • 1
0 votes
1 answer
41 views

Kotlin data structure for efficient lookup of nested data

I am currently working on an application that needs to create a mapping between document pdfs and corresponding JSON data files. The files are coming from a third party so I have no control over their ...
pbuchheit's user avatar
  • 1,663
0 votes
0 answers
20 views

Android - migration to Kotlin 2.0 causes errors

My Android App was working fine until I started migrating to Kotlin 2.0. All I changed in the build gradle was: changing these two lines id("org.jetbrains.kotlin.android") version "1.9....
Tobias Reich's user avatar
  • 5,122
2 votes
1 answer
28 views

How do I combine two different classes into one list?

I have two classes, the code is below. I need to put them in one list and sort them by the variable "time". Each class has "time" of type string. data class Event( var data: ...
tumannick's user avatar
0 votes
1 answer
20 views

Slow Gradle shutdown after testing with Testcontainers, Kotlin, Spring Boot

I have a Kotlin Spring Boot application that integrates with redis, and builds with Gradle. Recently I added some Testcontainer integration tests to make sure everything is working as intended. I ...
thatonetallguy's user avatar
0 votes
0 answers
8 views

App Locker for other applications in my application

I'm developing an android application with kotlin which I need to lock some installed apps in my device. first of all I'll display all installed app in a fragment and I did this successfully. second ...
mohamed hossam's user avatar
0 votes
1 answer
13 views

permission for saving pdf Android studio

i created a simple app that generated a pdf with 2 pages now i need to share the pdf and also save it in the device from what i already know it requires permissions to do that. i am new to this and ...
Jaimin Vashi's user avatar
2 votes
1 answer
45 views

Migrating to Kotlin 2.0.0 causes compile time errors associated with nullablity

I am currently migrating my Android application to Kotlin 2.0.0: val myConfig: Configuration? = null val myFrameRate: String? = getPreferences(Context.MODE_PRIVATE).getString("my_FrameRate&...
RichardMillhouse's user avatar
-1 votes
2 answers
48 views

how to solve the stupid error your project requires a newer version..?

BUILD FAILED in 1m 21s Running Gradle task 'bundleRelease'... 82.6s ┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────────┐ │ [...
Manoj's user avatar
  • 1
0 votes
0 answers
14 views

Ediitext getting under keyboard kotlin android

I have a fragment, in that i have a scrollview,(edittext inside scrollview) and recyclerview as well. when i am clicking edittext, keyboard is hiding it. I have only one Activity and many fragments ...
Abdul Rafay's user avatar
2 votes
1 answer
51 views

Resolving scroll conflict: PullToRefresh (vertical) vs. Horizontal Pager in Jetpack Compose

I'm developing a screen in Jetpack Compose that combines two scrolling components: a PullToRefresh for vertical scrolling and an ImageSlider implemented using HorizontalPager for horizontal scrolling. ...
Azin Alizadeh's user avatar

15 30 50 per page
1
2 3 4 5
3217