Questions tagged [android-ktx]

Android KTX is an open source set of Kotlin Extensions which aims to make Kotlin code more simple and clean when developing for the Android Platform. DO NOT use this tag in questions about the Android Kotlin Extensions plugin.

Android KTX is a library developed by Google that simplifies the way Android Apps are written with Kotlin. It is still in preview and may change anytime.

Resources

45 questions
1
vote
1 answer

How to set -noverify option with gradle ktx for android robolectric tests?

I am using Roboelectric for unit testing an android app, and bumped into an error while trying to write to SecureStorage - java.lang.VerifyError: Expecting a stackmap frame at branch target 10 I don't need verification enabled for unit tests, so…
ArieDov
  • 624
  • 6
  • 12
1
vote
1 answer

The new tag is not found in android.arch.navigation:navigation-ui-ktx

I saw that dialog fragments are now supported in the Android Jetpack Navigation component. When i use the dependency androidx.navigation:navigation-ui with its latest version, it works perfectly. However, when i use the dependency…
1
vote
1 answer

Run a method periodically using ktx handler extensions

UPDATE: Clarification, I am looking for an extension to run a function every 1000 ms for example, without needing to use handler.postDelayed twice. I've recently started using the android-ktx Kotlin extensions. And I've run into the handler…
1
vote
1 answer

Can't find `fun Cursor.getString(columnName: String): String` implementation

Where to these functions implemented? https://android.github.io/android-ktx/core-ktx/androidx.database/android.database.-cursor/index.html I saw package androidx.core.database but can't find implementation. There are only the functions like…
0xBADDCAFE
  • 25
  • 6
0
votes
1 answer

Android ActivityViewModels - what happens when activity is destroyed

I am trying to understand a bit of a scenario where we have a viewmodel created using ktx-library extension activityViewModels. I understood that it can be used by fragments that wants to share viewmodel with other fragments within the same…
srisindhu saride
  • 391
  • 6
  • 25
0
votes
1 answer

Kotlin: How to filter elements from a list lower than the first element?

I have a function chain going and I need to filter items from a Kotlin list that are lower than the first item. For example, in [3, 5, 2, 7, 1, 0, 9] I want to be left with [3, 5, 7, 9] I don't see a way to compare by a value in a functional chain…
Nic Wilson
  • 150
  • 3
  • 10
0
votes
0 answers

flutter build could not find core_ktx

I'm trying to build an android app from a flutter project that is previously working without problems the error I got is Execution failed for task ':app:mergeKoutDebugAssets'. > Could not resolve all files for configuration…
Ali Habbash
  • 777
  • 2
  • 6
  • 29
0
votes
1 answer

How add dynamic values in Kotlin Flow

if we know list values to be processed in Kotlin flow then we can follow the below function flow { (1..1000).forEach { delay(1000) //Process Data emit(it.toLong()) } }.collect{ …
Mohan K
  • 464
  • 5
  • 18
0
votes
1 answer

Firestore search array contains for multiple values Android

I am using Cloud Firestore and within collections,one named "channels" containing the following values -> users : ["_id1","_id2"] I have to search in a way to check both the values from users array. I am trying this way but its giving me…
user13871738
0
votes
1 answer

ViewModel observing data changes in other fragments

I have a items fragment which lists all the items and one other fragment which will use items list to create a sale document. I am using same viewModel for both of them when ever I filter items in items fragments, items in sale fragment are also…
0
votes
0 answers

My Firebase database code is not executing

My Firebase database just simply doesn't work in Kotlin, every listener (onComplete, onFailure etc) doesnt work and I don't know why. It'a problem in my other project but i created another one just to make sure and it still doesn't work. Here is my…
0
votes
1 answer

Does changing the Kotlin JVM target cause any issues?

Whenever I use Fragmet KTX in my projects, specifically binding viewModel using property delegates (viewModels & activityViewModels) I face an compiler error: Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with…
Vandit Goel
  • 620
  • 2
  • 9
  • 19
0
votes
1 answer

how to enable button if 2 edit text is fill?

how to enable button if 2 edit text is fill use 'androidx.core:core-ktx:1.1.0'? override fun onActivityCreated(savedInstanceState: Bundle?) { super.onActivityCreated(savedInstanceState) editTextEmailOrPhone.doOnTextChanged {…
Afdal
  • 501
  • 9
  • 19
0
votes
1 answer

Databinding : Failed to call observer method / Resources$NotFoundException

I am working on a very simple sample app that uses ViewModel, coroutines and databinding. Here the very simple classes used : class MainFragment : Fragment() { companion object { fun newInstance() = MainFragment() } private val…
rolandl
  • 1,769
  • 1
  • 25
  • 48
-1
votes
1 answer

Pros and cons of having built-in Kotlin suport vs KTX add-on package

I am building an Android SDK in Kotlin that would be consumed by both Kotlin and Java users. It relies of common language patterns for Java & Kotlin like callbacks for async operations. In order to improve DX for Kotlin coroutines users I want to…
Maciej Jastrzebski
  • 3,674
  • 3
  • 22
  • 28
1 2
3