Questions tagged as 'kotlin'

1
answer

Send the uri to play sound through an array

Good I am practicing with the typical application where creating an object is filled with parameters through a array and then those data are sent to another screen, and I would like to send the uri ( R.raw . "the file "). I have...
asked by 24.05.2018 / 18:02
0
answers

How to avoid screen capture in my activity?

I have content in an activity (image) which has the option to download, when downloading the image will show an ad (1 every 2 min) ... I want to prevent users from taking screenshots in that activity or application and so they must download i...
asked by 05.05.2018 / 19:32
2
answers

Problems with TextView in Android Studio 3.0.1

Hello, I am using Android Studio 3.0.1 and the TextView marks it on red as an error, says    Function invocation 'TextView (...)' expected None of the following   functions can be called with the arguments supplied. (Context!)   defined i...
asked by 08.03.2018 / 04:39
1
answer

Specify time zone in log outputs

I am developing a project in Kotlin and Spring and a question has arisen with a log and the time zone used. We use LoggerFactory to write to the standard output information about the events (an event log) but the The time it shows is not adequ...
asked by 31.01.2018 / 21:40
2
answers

Variables with Kotlin

I'm trying to complete a url by means of variables but when I pass it and add it to the url I want to connect to, it gives me an error override fun onCreate var mparam = intent.getStringExtra("param") object Detalles { const val C...
asked by 29.12.2017 / 10:17
1
answer

How can I parse more objects that I have within arrays in JSON and kotln?

   Quotation in block What I want is not to repeat code can pull the data without doing array, array1 etc how can I do it? val stringRequest = StringRequest(Request.Method.GET, URL_DATA, Response.Listener { response -> progressDial...
asked by 22.03.2018 / 21:42
1
answer

Android studio 3.0.1 does not recognize external physical (cellular) device for testing

In the new android studio in its version 3.0.1 I can not install the .kt file to run it on an external cellular device. I made all the settings in the phone (I set developer mode and enable debug mode by USB). Try modifying the file of...
asked by 16.01.2018 / 04:06
1
answer

Save string in a txt file

This is the code that I am implementing, I have also tried it in other ways, however in all the occasions that I execute it the application closes immediately fun writeToFile() { val text = "Prueba texto" File("output.t...
asked by 08.03.2018 / 15:31
2
answers

problems perform cast kotlin on "android"

I'm trying to do "castings" in android kotlin mendiante, as I did a couple of months ago ..... but I always get an error, do you know if it's a bug? So far I was casting this guy and they worked for me var variable1:Int=12.11 as Int var var...
asked by 10.06.2018 / 18:26
3
answers

How to know if a variable has been initialized (Kotlin)?

I'm using Kotlin and at the beginning of my application I declare a variable that I initialized later, with the aim of not declaring it as null at the beginning and thus avoiding the annoying signs of Nullability (!!): private lateinit var var...
asked by 01.10.2017 / 19:22