Questions tagged [kotlin-android]

49 questions
1
vote
0 answers

set a custom style into app:tabTextAppearance programatically for material tabLayout

Recently I'm start using MDC's tabLayout and with the help of some answers of stackoverflow I'm able to change tabTextAppearance from xml -
mefahimrahman
  • 197
  • 2
  • 6
  • 29
1
vote
0 answers

How to inherit another coroutine scope in a custom coroutine scope?

I was implementing viewHolderScope for collecting flows in RecyclerView.ViewHolders. It would start from onBindViewHolder and gets cancelled onRecycleViewHolder. But along with this requirement, it should also automatically get cancelled when the…
Sourav Kannantha B
  • 2,860
  • 1
  • 11
  • 35
1
vote
0 answers

Kotlin RecyclerView - Update item to DB

I have a category item in my recyclerView. There is a TextView and two ImageView as button (Edit button and Delete button). When I click edit button I want to change TextView to EditText and editbutton change for agreebutton. When I write new text…
0
votes
0 answers

logging interceptor doesn't get added with koin

So. i'm trying to learn Koin, and trying to build an OKHttpClient with Logging Interceptor. But, when i tested it, it seems like the Logging Interceptor doesn't get added. single { HttpLoggingInterceptor() .setLevel( if…
lelestacia
  • 201
  • 2
  • 9
0
votes
0 answers

How to modify native NavigationView Menu group's separator in Android

I have Android Kotlin project, where I am trying to separate NavigationView's menu items from each other like so: separated items by grouping them But I am not satisfied with spacing between groups, they are not matching my desired UI design. And…
0
votes
1 answer

NullPointerException while retrieving data from room

I have 3 entitites (Location, Current and Forecast) with following relationships: 1.) Location - Current (one-one) 2.) Location - Forecast (one-one) Now to retrieve data from it i wrote a query @Transaction @Query( "SELECT…
0
votes
1 answer

How to load files on startup using a saved URI string in Android?

I tried to load images from a directory using Intent.ACTION_OPEN_DOCUMENT_TREE and it worked fine until I tried to save the URI I got to preferences. Then I could read it but there were no files in the directory (tree.listFiles() from the chosen…
0
votes
0 answers

Create callBack with hilt - android kotlin

I write a callback with hilt and it good work when I test it just for call. But when I use like bellow get me *throw catch*: My Interface is: interface ButtonCallback { fun onButtonClick() } And…
jo jo
  • 1,758
  • 3
  • 20
  • 34
0
votes
1 answer

How to get bluetoothClass.Device for tablet?

In my app I am checking the discovered bluetooth devices type by Class bluetoothClass.Device I want to check if device is tablet or not but I can not find anything to check is device tablet or not. I am checking devices here as follows: if…
Assad khan
  • 161
  • 2
  • 9
0
votes
0 answers

Android Studio Kotlin: Why my Button continually causes crashes when I clicked it

i am making a voice recorder activity, but when i press the button to play the recorded voice it give me a message "unable to play the audio file: /storage/emulated//0/recorded_audio.mp3: open..." Here's the code: val hintBar: TextView =…
0
votes
0 answers

Matching arguments not matching arguments[1] and arguments[2] matching are swapped by mockk

I want to test that on click, user is being navigated to the correct screen. I can see the correct button is clicked after I do performClick() in my tests but it is saying the call happened with different arguments. I can't figure out what is…
Hobo
  • 43
  • 6
0
votes
0 answers

How play(), pause(), stop() functions work while using rive with Android Development in kotlin

I am trying to add a progress bar from rive to my android with kotlin, but when every i use play(), pause(), stop() methods, app crash. Can anyone plz, explain how to solve this and i have seen there are so many arguments we have to pass while using…
Jayesh Hadke
  • 11
  • 1
  • 2
0
votes
1 answer

Two Way Binding on Double Android

I read a few posts to convert from String to Integer and tried to do the same to convert string to double using two-way binding but was unable to do it. SampleViewModel.kt class SampleViewModel: ViewModel() { val weight =…
Muhammad Yousuf
  • 127
  • 2
  • 16
0
votes
1 answer

Hoping to display a value every 3 seconds using thread.sleep. However, it's not working

im taking this kotlin basics in google and im in the "intro to debugging" section.. total noob here and i've managed to plow through the subjects and now im stuck here.. so the expected outcome is for the textview to display a quotient every three…
0
votes
0 answers

How to show dynamic date as Header in the RecyclerView?

I want to show the date dynamically in the header of the RecyclerView and group the items of that date inside it. My data class looks something like this data class Feed( val id: String = "", val title: String = "", val createdAt: Long…