Questions tagged [kotlin-android]

49 questions
18
votes
6 answers

How to solve this Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE

Have been trying to solve this but couldn't . this is udacity lesson where i am trying to create notifications using pending intent but there is problem with Pending Intent being Mutable i tried with this way ViewModel private val REQUEST_CODE =…
Shiva s
  • 710
  • 1
  • 6
  • 13
7
votes
2 answers

Show trailing icon after text input from user in TextField Jetpack Compose

I am trying to: make the trailingIcon of TextField composable visible only if the user enters some text other than white spaces. Later when the user clicks the trailingIcon the text in the TextField should get cleared and the trailingIcon should…
4
votes
1 answer

how to make two circles with jetpack compose

I want to make this shape with jetpack compose how can I do it?
Null
  • 107
  • 1
  • 7
4
votes
1 answer

What does the single exclamation "!" mean after the type in Kotlin?

I'm learning to Develop Android Apps using Kotlin. I previously used to Develop using Java. While coding in Android Studio, I can see that the return types, parameters, etc. used in the Lambdas, methods, etc. are written as View!. I know that the ?…
Amey079
  • 131
  • 7
4
votes
3 answers

How to get location using "fusedLocationClient.getCurrentLocation" method in Kotlin?

To request the last known location of the user's device, we can use the fused location provider to retrieve the device's last known location using getLastLocation(), but using getCurrentLocation() gets a refresher, and more accurate location. so,…
Ahmed Maad
  • 367
  • 5
  • 16
3
votes
1 answer

How to create a two colour striped Drawable programmatically?

Similar to this question asked over 10 years ago: banded background with two colors? I need to create a drawable to be the background of a generic view that has two distinct rectangular striped colors, like a flag. Bonus if I can make one of the…
2
votes
0 answers

App Open Ad is showing app content in place of advertisement

My app was getting too high CTR for AppOpenAd which was around 35%-40%. So after looking for the issue I found that the AppOpen Ad is displaying the AppContent background in place of the advertisement. Below are the screenshots to demonstrate the…
2
votes
0 answers

E/ActivityTrigger: activityResumeTrigger: not whiteListed Error (kotlin- android)

In kotlin I am making app to signUp, Login and then after successfull signIn user will be forwarded to home screen where all users will be displayed, So I am fetching data from database to show in the recyclerView and getting this error :( please…
2
votes
1 answer

Difference between plugin "kotlin" and "kotlin-android"?

Whats the difference between plugin "kotlin" and "kotlin-android"? Could not find a docu about it. The official Kotlin Documentation only talks about apply plugin: 'kotlin' But if you create a new module in Android Studio you currently get apply…
David
  • 3,971
  • 1
  • 26
  • 65
1
vote
1 answer

Custom Overflow Menu Of Toolbar Android

I am trying to implement a custom overflow menu in a toolbar, the image is attached for reference. I went through many tutorials and articles to implement the desired result but was unable to do it. I managed to implement it a little bit but was…
1
vote
0 answers

Compose android tests fail when minify enabled, class / methods not found

My Compose unit tests fail if I have minify enabled on my app. java.lang.NoSuchMethodError: No interface method complete()Z in class Lkotlinx/coroutines/CompletableJob; or its super classes (declaration of 'kotlinx.coroutines.CompletableJob' appears…
Jeffrey Blattman
  • 22,176
  • 9
  • 79
  • 134
1
vote
2 answers

How can I securely store data on Android that will survive a reinstall?

Looking at older posts here on Stack Overflow, it appears this is not possible. But I'm wondering if there are any newer SDK APIs that support this ability? In my specific case, I need to create a UUID the first time my app runs because Android…
Bungles
  • 1,969
  • 2
  • 25
  • 54
1
vote
2 answers

ML Kit barcode Scanner don't stop when first is detected

I'm trying to get two values ​​from cameraX and ML Kit using the barcode scanner (rawValue and format) but I can't stop the scan and insert data into room when the first one is detected. My code inserts in room as many elements as many barcodes are…
1
vote
0 answers

Twitter API Retweet Auth Failure

I'm trying to implement Twitter's Retweet API to retweet a specific tweet. But I'm having AuthFailureError while requesting that API. I'm unable to solve this issue and stuck for many days. Any help would be appreciated. Code: private fun…
AtifSayings
  • 756
  • 14
  • 23
1
vote
3 answers

Async requests in Kotlin Android

I often get an error android.os.NetworkOnMainThreadException, when I try get info from some api. I know that this problem is related to the main android thread, but I don't understand how to solve it - coroutines, async okhttp, or both? P.S I have a…
1
2 3 4