Most voted "kotlin" questions
Kotlin is a statically typed programming language compatible with JVM and Javascript.
Learn more…234 questions
Sort by count of
-
0
votes0
answers38
viewsHow to do a same @Multipart POST call by sending an image, String fields and also an Array of objects?
On a call, I register a professional, which involves sending your avatar, which appears in the first line as file and also send other attributes of the professional, for example, the place where he…
-
0
votes0
answers7
viewsAndroid Studio is not recognizing Log command. v (Kotlin)
I am a beginner in Kotlin and I have a problem with a simple Kotlin code with the following command line: Log. v("Appconsvar", "Dollar value: $valDolar") that Android Studio is not recognizing the…
kotlinasked 3 years, 2 months ago user226893 1 -
0
votes1
answer55
viewsDynamically pick up color
I created some colors in the file colors.xml <color name="colorBackground1">#5c6bc0</color> <color name="colorBackground2">#1e88e5 </color> <color…
-
0
votes0
answers80
viewsProblems receiving data from another Activity Android Kotlin, Intent must not be null
Hello, I am trying to pass the data I receive from a call to the API, and send this data to the next Activity, however I am receiving that Intent is null, as code below. I have tried changing the…
-
0
votes0
answers28
viewsAndroid Unit Test -> Problems mocking a method that has static class
I am doing unit tests of my Viewmodel and have a method that saves the data in Firebase generating an id internally with the help of the Base64 class. In my class structure I call the…
-
0
votes0
answers78
viewsHow to validate if the cookie was created by the server?
Summary: I have a webservice with Quarkus(Jax-rs) and Vue.js, I do a validation basic Authentication and then I create a cookie httpOnly encrypted... When I receive a new request I cannot check if…
-
0
votes2
answers161
viewsWhen to use Livedata or when to use Rxjava (or Rxjava2 / Rxkotlin)?
After the LiveData was introduced as architecture component of Jetpack, I have seen much discussion about the use of it. The most common is that it is used in the layer viewmodel of MVVM, standard…
-
0
votes1
answer118
viewsInstantiate Dependency Injection Class using Kotlin in Unit Tests
I’m trying to find a solution for how I can instantiate a class that uses dependency injection into unit testing using Kotlin and Junit. I have a class that uses addiction injection: class…
-
0
votes1
answer28
viewsDoubt about a Fragmentstateadapter constructor
Fragmentstateadapter has three builders according to the documentation. (@Nonnull fragmentActivity: Fragmentactivity) (@Nonnull Fragment: Fragment) (@Nonnull fragmentManager:…
-
0
votes1
answer42
viewsFirebase Data Filter(Kotlin)
Speak for yourself Blz? I’m a beginner in Kotlin and Firebase! I’m trying to do a search on firebase in a collection that has user task data, I wanted to filter by ID, follow example: My search at…
-
0
votes1
answer167
viewsOverwrite an Inheritance property or not ? Kotlin
I have a question about code : class SaldoInsuficienteException(mensagem:String = "O saldo é Insuficiente") : Exception(mensagem) Now I tested imagining how the code was written in English and the…
-
0
votes1
answer65
viewsKotlin - Pass data between Fragments
I’m having a problem with an app I’m designing. I have 3 Fragments ( F1, F2, and F3): In F1 (contains a list with a series of sports) the user makes the choice regarding a sport (I use a Recycleview…
-
0
votes0
answers40
viewsCustom Validation using Kotlin
I am trying to create a validation where it is necessary that the phone or mobile phone is required (when one exists the other is not required, if both are empty one or the other needs to be…
-
0
votes0
answers26
viewsFirebase Child data is returning null. Kotlin Android Studio
Eai personal! I need to return the current user’s name and surname, registered in firebase. However, I have tried several implementations and none of them returns the result I want. In this last…
-
0
votes1
answer70
viewsMy material components are not being recognized in my Activity
Reinstalled Android Studio on my computer, went to make a basic application Only login screen and a button to advance But in Activity, when typing the id that was assigned in xml, the Kotlin file…
-
0
votes1
answer337
viewsCaptiulo 1, Kotlin in Action, Expecting a top level declaration [Beginner]
I’m learning Kotlin, I can’t understand why the problem "Expecting a top level declaration". The result I intended was that I pointed out Bob as the oldest data class Person(val name: String, val…
kotlinasked 3 years, 12 months ago Cristopher Vieira 11 -
0
votes1
answer20
viewsAndroid/Kotlin - Select Current Fragment
In my action I use the method onBackPressed. When will I compare the fragment that triggered the event the Id is never the same and always falls in the else. what is wrong? override fun…
-
0
votes0
answers56
viewsHow can I compare two or more values using the match function in Kotlin
I’m using Kotlin with Mongo and have the following code snippet: match(equal(Industry::addresses, Address::category, value = AddressCategory.MAIN.toString())!!) The category of this address can be…
-
0
votes2
answers41
viewsKotlin+Springboot [Beginner] I can’t create Post method
I didn’t even want to go to Stack in such a simple problem, but it’s already dragging on for days and I managed to implement the GET method with a certain ease, I’m learning Kotlin and java, I’m not…
-
0
votes0
answers11
viewsWiremock not ordering withRequestBody
I am implementing some tests in my application as follows: stubFor(post(urlPathEqualTo("endpoint")) .withRequestBody(equalToJson(stringJson, true, false))…
-
0
votes0
answers14
viewsProblems with the Android Update-In-App
Come on, you guys... Has anyone used the update-in-app for Android playcore? I can call the update dialog, it downloads the version, restarts the app, but it n updates from vdd to new version.…
-
0
votes0
answers37
viewsRequest problem that only falls in catch
I’m working on a new project so I don’t have much control of the code and I’ve reached a problem where the request doesn’t work or returns something where I can’t solve , it just falls into the…
-
0
votes2
answers72
viewsHow to access a String inside the body() in the retrofit in Kotlin?
I’m trying to access the json content inside body() through retrofit. I need the "url" in String. What’s missing from my code? Debugging the code I saw that the response.body() is returning the…
-
0
votes0
answers32
viewsUsing the filter method with Kotlin
I have the class Posicao and in it I have an attribute data: LocalDate. I have an Array of FaixaPreco which contains 12 objects, 1 for each month of the year. Based on the position date, I wanted to…
kotlinasked 3 years, 10 months ago João Pedro 9 -
0
votes1
answer39
viewsRecycler View is having overwritten elements when I make a new data request
I’m having trouble requisitioning and putting the results in Recycler View. Whenever I make a new request Recycler View has the elements replaced instead of preserving what has already been called…
-
0
votes1
answer141
viewsPackaging in Kotlin
I am starting my studies in Kotlin and am trying to solve the following problem: Create a class to represent a person, with private attributes of name, date of birth and height. Create the necessary…
-
0
votes1
answer32
viewsHow can I resolve this NPE error when fetching data in an API?
I’m looking to do a search on the Github API using Kotlin Coroutines in a different thread than the main one, but by receiving the values, it’s generating this error: 021-01-27 19:50:22.961…
-
0
votes0
answers6
viewsCustom spinner not correct image arrow
I have a custom spinner, I am correctly assigning the name, but the image is repeating in all items on the list. class Server(val context: Context, var servers: Array<ServerCode>) :…
-
0
votes0
answers24
viewsTrouble with Rabbit and Spring
Talk about beauty? I’m having a problem using my application with Rabbit via Docker. Here’s what you get: I created a Docker-Compose, it follows: version: "3" services: rabbitmq: image:…
-
0
votes0
answers29
viewsHelp with Firebase and Android studio, collect data
Guys I have the following list in the database Opening each user of the list I have this information I need to take this information and play for a model class android studio, for this I’m using a…
android-studio firebase kotlin crud realtime-databaseasked 3 years, 9 months ago Felippe Pinheiro 11 -
0
votes0
answers32
viewsConvert Bytearray to Multipartfile without using the Mockmultipartfile class
I have a Bytearray type attribute (byte[]) and would like to convert it to a Multipartfile. After that I would like to take this multipartFile and send it to a function that will perform a request…
-
0
votes0
answers43
viewsflutter - Migrate to Android embedding v2 - plugin audioplayers error
I have a bit of a problem (I believe). Earlier today, I was working on my app and everything was ok, but now at night I went running and got this error message: Upgrading to Android embedding v2 (I…
-
0
votes1
answer155
viewsRecyclerview No Adapter Attached; Skipping layout (Kotlin) How to resolve?
Oops guys, I’m having this problem. I’m developing a CRUD in Kotlin and I’m having difficulties in the database reading page... Once I enter Activity, loads the Textsviews and all the other elements…
-
0
votes1
answer15
viewsTrade an image with Kotlin?
Hello I am new learning Kotlin and I have the following problem, I have a View image with two buttons, move forward and backward. In a gallery of 5 photos I would like to keep exchanging images so…
-
0
votes1
answer39
viewsWhere the return is List<List<String>> convert this result into List<String> only by combining the elements
Considering the implementation below: fun main(list: List<String>) { val x = list .stream() .map { findMessages(it) } .collect(Collectors.toList()) } fun findMessages(s: String) :…
-
0
votes1
answer25
viewsHow to perform Flatten with reactor?
I have a list of strings, where I convert to a Flux. And, for each Flux, I perform a flatMap which, in turn, returns a list. Further ahead I run a collectList() which converts Flux to a list. As a…
-
0
votes1
answer24
viewsResponse from the API
I am implementing a Search function in a list, I want to get the answer from my API to see if it is correct for my Search. How do I get the response of a fun @GET from my API? I’m using Retrofit…
-
0
votes1
answer21
viewsError with Nav Controller
I am facing problems running my app because it does not open the main, the problem is in my Nav controler but do not know how to solve it. Log: E/AndroidRuntime: FATAL EXCEPTION: main Process:…
-
0
votes0
answers25
viewsInactive GPS notification running on APP startup only
Ola, I need to adjust the app I’m developing so there’s notification whenever GPS is disabled. When the app starts, if the GPS is disabled, it alerts and then starts the Switch to location settings.…
-
0
votes0
answers22
viewsAsynchronous Tasks using Kotlin Coroutines
I’m readjusting an application and need to implement asynchronous routines using the coroutines. I am currently trying to use the function 'Globalscope.Launch(Dispatchers.Main) {}' as an alternative…
-
0
votes0
answers13
viewsLoad specific items from a recyclerView
I have an Adapter that loads all data from my list, in my list there is a Boolean field that I will use to filter the favorite items, as I do so that in my recyclerView I select only those that are…
-
0
votes0
answers11
viewsI can’t authenticate firebase by following the Steps
private lateinit var auth: FirebaseAuth class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { auth = Firebase.auth super.onCreate(savedInstanceState)…
kotlinasked 3 years, 4 months ago Pedro Tavares 1 -
0
votes0
answers9
viewsInitial step when creating a navigation in Android Studio
It’s very basic, but I’m not able to implement it. I’m wanting to start studying navigation, but not being able to implement it correctly. On the android site they ask me to put this code in the…
-
0
votes0
answers16
viewsHow to use Reference in Firebase?
I am training in a digital point hitting app, and I wanted to know how I could create a rule for each user to be able to register 4 daily point i would have the Users document and the Records…
-
0
votes1
answer24
viewsHow to check if a phrase/string contains words from a list in Kotlin
I’m having trouble with the operator in, when I have only one operating i can easily verify if a certain word is contained in a list, for example: fun main(){ val cores = listOf( "branco", "azul",…
-
0
votes0
answers11
viewsHow to pass URL dynamically using Feignclient Kotlin + Springcloud
In my code where I search a list of clients of a particular company, however according to the name of the client I must do the search in a certain third party Endpoint. In my example (below) come on…
-
-1
votes1
answer178
viewsHow to check the number of words in a String?
Well, I’m doing a job for college where I need to identify the number of words that a string has in Kotlin. Type : texto = "Ola Mundo" The variable numeropalavras has to be equal to 2. Is there a…
-
-1
votes1
answer207
viewsHow can I add 2 submenu buttons in Android Studio
I would like to add dynamically options to my screen menu on Android, I saw several examples, but all facing a single button. supposing that I have. override fun onCreateOptionsMenu(menu: Menu,…
-
-1
votes2
answers228
viewsHow to pass a search parameter in the retrofit with Kotlin?
I am trying to use the Retrofit library to make HTTP requests for the API: API Star War, with the Kotlin language, however I don’t know how to correctly pass a search parameter to an API function.…
-
-1
votes2
answers310
viewsHow to remove url bar and buttons from a webview browser
Hello, I’m new to Kotlin and I’m using a Project in webview to mirror a website in the App. However, the only page that comes perfect is the home, the external links the App uses a Webview Browser.…