Questions tagged as 'kotlin'

1
answer

Access list from within a ViewHolder in Kotlin

I need to access a list that is in the Adapter, however, I need to access being in a ViewHolder, I know that with Java it would only refer to the list, but in Kotlin the list is not recognized, class SearchFilterAdapter(private val filterList:...
asked by 25.05.2018 / 21:38
1
answer

Kotlin + RX Observer without Anonymous

I'm studying Kotlin Android and RX and just see examples like: val api = StarWarsService() api.loadMovies() .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(...
asked by 12.04.2018 / 19:40
1
answer

Apply setItemOnClickListener to Button GridView. Kotlin or Java

I've done a gridView of buttons, but when I use the setOnItemClickListener method to trigger the respective buttons, it does not work. I want to use the buttons so that I can trigger an intent, knowing that you can only trigger an intent with...
asked by 16.10.2018 / 14:43
1
answer

Thread Problems (Koltin)

I'm in a situation where I'm building an android APP to keep looking at Bitcoin's quotations on the Bitcoin Marketplace site. The APP is already working, the last thing I want to implement is the automatic query at time intervals. The star...
asked by 06.07.2018 / 18:01
1
answer

Error: mismatch "$ {body.toString ()}" in Kotlin

I have this 'Type mismatch' error in this code '$ {body.toString ()}': fun fetchJson(){ val url = "http://localhost:8080/matematica3/naoAutomatica/get" val request = Request.Builder().url(url).build() val client = OkHttpClie...
asked by 05.07.2018 / 17:30
1
answer

How can I add 2 buttons with submenu in Android Studio

I'd like to dynamically add options to my screen menu on Android, I've seen several examples, but all turned to a single button. Assuming I have it. override fun onCreateOptionsMenu(menu: Menu, menuInflater: MenuInflater) { menu.cl...
asked by 16.07.2018 / 20:01
2
answers

Is it possible to call a method inside another instance?

I have a Activity that shows a custom AlertDialog , as the class of Activity was kind of big I put the call of this Alert in another class in a static method. When I clicked on a certain Alert button (or when I closed it) I w...
asked by 26.03.2018 / 04:41
1
answer

Edittext losing focus in ListView header

I put header on my ListView because I wanted it to roll along with it. In this header there are two EditText , when I click on the second, the focus comes back first in less than one second. You do not even have time to write...
asked by 16.02.2018 / 21:31
1
answer

How to convert an object into kotlin of type Any! to anyone else who can access the fields?

Good morning, I'm having a rather annoying problem of being solved in a project. I'm trying to make an application that will communicate with odoo ERP, however, this ERP uses the xml-rpc protocol for their requests. To make the requests I'...
asked by 24.01.2018 / 13:30
1
answer

Kotlin - R.string.navigation_drawer_open, Not being imported?

I'm trying to learn Kotlin, but, I'm not able to use navigation_drawer_open , nor navigation_drawer_close , as the attached image demonstrates Would anyone give me a hint of what to do to fix the problem?     
asked by 08.01.2018 / 23:08