kotlin's questions - Japanese 1answer

0 kotlin questions.

I have several classes that implement an abstract class "Product". To follow the Open-Closed-Principle I would like the implementation classes in a way that they register themselves in a ...

I have some code that I've been using for years in Java, but need it in Kotlin (its interfaces extend collections interfaces). Some classes are serializable. When I try the obvious, I get "Cannot ...

I made a simple downloader application. When I run it through IntelliJ idea, it works flawlessly, but when I build the JAR file and run that, I get 403 error. This is the (kotlin) code I'm using: ...

I want to create TableLayout in my fragment to insert data. I used for that this methode below. I have to call the methode updateTable outside of the onCreated view method. But I got always this ...

I would like to create an recyclerView in a fragment, but it shows an error " java.lang.IllegalStateException: recylerView_Main must not be null at com.gph.bottomnavigation.FragmentMe....

I want to initialize socket IO in my kotlin app. my problem is here : private var mSocket: Socket? = null { try { mSocket = IO.socket("http://chat.socket.io") } catch (...

My projects Map activity is not working I just pasted the api key in place google_maps_api.xml and clicked run Logcat: E/AndroidRuntime: FATAL EXCEPTION: Thread-5 Process: com....

I call a function of MainActivity in other Activity, the app shut down and show the error as below, please help to solve this issue. MainActivity function: fun checkInternet():Boolean { val cm =...

I am currently detecting when a specific view becomes visible to the user or goes out of sight and stopping the RecyclerView scroll at that view position. So far I have been able to achieve this with ...

How to add an item to an ArrayList in Kotlin?

D/OkHttp: --> GET https://example.com:PORT/... http/1.1 Authorization: Bearer example token Device-Type: Android --> END GET I just see request information and I will not get any ...

I want to use kotlin and mqtt in a taxi application. Drivers are listening on drivers and rides topic. /srv/driversand/srv/rides As a backend user I want to retrieve subscribed drivers from drivers ...

I have a problem with capturing the Class argument via ArgumentCaptor. My test class looks like this: @RunWith(RobolectricGradleTestRunner::class) @Config(sdk = intArrayOf(21), constants = ...

I'm trying to make some tests and i need to replace the real dependency by a fake one by overriding it on KODEIN but it's not working and i don't know what i can do anymore. Here is my dependency ...

When I am trying to add the image in layout the app is working fine in lolipop but crashes in marshmellow. If that images is removed then app works fine. It gives error when image is inserted and ...

The Code A works well, but I get error when I replace import android.preference.DialogPreference with import android.support.v7.preference.DialogPreference why? Error onCreateDialogView() override ...

When calling the saveAll method of my JpaRepository with a long List<Entity> from the service layer, trace logging of Hibernate shows single SQL statements being issued per entity. Can I force ...

i am writing my first kotlin app (for android) and i can't seem to make it crash... wait, what? - yes, i intentionally want to make my app crash. in my app i have an enum, and just like many other ...

While running the project, I receive the following err message [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.2.RELEASE:run (default-cli) on project KotlinJwt: An ...

I am trying to understand ViewModel and LiveData concepts in android. I am making a practice project but when i added implementation 'androidx.lifecycle:lifecycle-extensions-ktx:2.0.0-alpha1' line in ...

I have an Android App developed using Java. I now want to start using Kotlin for the same app. Is it possible to use Kotlin and Java side-by-side in an existing app?

i create custom view that accept fragment. So, later my custom view have dynamic content (Fragment). But i got this following error when adding fragment. Caused by: java.lang.IllegalArgumentException:...

I'm really new to Android and I know I don't know much of the terminology, so I will try to explain myself as best as I can, please bear with me. I have an app, I need it to have 4 tabs, 3 of them ...

How can I get multi-line queries to be injected? It works on Room with Java classes, but does Kotlin support this as well? E.g. I have 2 queries here, and only the top SQL query (1 line) gets ...

I have a stream: val symbols: Single<List<Symbol>> Now I want to transform the stream into a UI State with map(): private fun cool(): Single<SymbolContract.State> = symbols....

I'm trying to construct a request from a WebResourceRequest, the problem is I don't see an API for getting the http body. Any thoughts? val url = request?.url?.toString() val ...

There is an issue on github, but now objectbox not supports cascade deleting. Are there any other options to do this except manual removing? For example, models: @Entity class User(val username: ...

I am attempting to search for all users who are a part of a given club/organization. I would have both the clubsOrgsId and clubsOrgsName. In the list of users these two data points are in an object ...

I'm trying to find a way to get the product of a List or Array without using "repeat" or any loop on Kotlin but after some research I couldn't find anything similar. Something like this in Python ...

To clarify my question.. When we use override fun onClick() we have to Register the body of the function, using something like this: Variable.setOnClickListener(this). Whereas the first one onClick ...

Is there any fancy way to implement debounce logic with Kotlin Android? I'm not using Rx in project. There is a way in Java, but it is too big as for me here.

I'm a little bit desperated. I develope an android app, which is connectable to an Adafruit Bluefruit.I watched a lot of tutorials and try out many thinks. With the nRF Connect Application I can ...

I am using RecyclerView in Fragment. clicking on RecyclerView items is also reflect on another position like, if i select 0 position position 11th also set as selected, if i select 1st position then ...

I'm trying to create my first app in Android Studio with Kotlin. The installation worked fine. However if I drag any element onto the Layout, it's not showing up properly. The only change I can see, ...

whats wrong with this code? help please val filesDir = filesDir val todoFile = File(filesDir, "todo.txt") items = ArrayList<String>(FileUtils.readLines(todoFile)) //PS: FileUtils is from (...

I'm trying to integrate Toothpick library without reflection into my multi modules project. I follow this guide in order to connect all my modules with DI. For example I have three module: :app, :...

I constructed MVVM and get data from Network by Retrofit 2. Getting data flow goes like this: MainActivity - > ViewModel -> Repository -> APiService. So, I call enqueu from the Repository, like this: ...

Background I have a TabLayout with some elements in it. In portrait mode, the elements don't have enough space to appear. So I used: app:tabMode="scrollable" On the other hand, in landscape mode, ...

I use Kotlin and Mongo (with KMongo) and I have multiple models as UserEntity, MovieEntity and so on. Each of them use a specific Dao class to do (actually) the same methods. Therefore, I'm trying to ...

I have a listview with list selector, and I was wondering if it is possible to have a button to unselect the item and leave the list with no item selected (I want to remove just the Highlight bar, not ...

Problem I am working with Android and Kotlin and I would like to have an annotation to check if a constant String parameter (to a function or constructor) matches a certain pattern (regex). I read ...

I am using photo editor library which takes image uri as input. I am giving option of camera for to user. In EXTRA_OUTPUT of intent i gave uri of file where captured image should be saved and then i ...

Here is my source code link idea-run-typescript. Can't save run conf field change Action can't show for TypeScript only Can't print debug log Can anyone help with this?

I was looking through array extension functions and found reduce() one inline fun <S, T: S> Array<out T>.reduce(operation: (acc: S, T) -> S): S { if (isEmpty()) throw ...

I want to create multi-module project with common module written in Kotlin which compile to JVM bytecode and JS code. Is it possible to use JS-code compiled with kotiln2Js by any frontend framework ...

When I'm trying to create the following code: class SmartCast { var array: MutableList<Int>? = null fun processArray() { if (array != null && !array.isEmpty()) { ...

I want to test a controller, that returns page using Thymeleaf template, with MockMVC. This is my test: class PostControllerTest { ... @BeforeClass fun setUp() { ...

What is the easiest way to concatenate two byte arrays in Kotlin? Consider, val x = ByteArray(a); val y = ByteArray(b); Help me to concatenate two byte arrays x,y and store it in another ByteArray?

Activity receiving intent class AddNoteActivity : AppCompatActivity() { private lateinit var addViewModel: NoteViewModel private lateinit var titleEditText: TextInputEditText private ...

So I wanted to list the contents of Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) which is apparently at /storage/sdcard/Download So I do so by using list(). I have ...

Related tags

Hot questions

Language

Popular Tags