https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
stackoverflow
  • u

    user

    06/22/2022, 1:11 PM
    Android Background Get Blackened When Capturing Screenshots with DrawingCache I have implemented an in-app feature to capture screenshots following this thread accepted solution. How to programmatically take a screenshot on Android? Issue is, in set of layouts in my application (Which I am currently developing but not initially developed by me) the android:background property is not been set. It renders window background color when it displays but when...
  • u

    user

    06/22/2022, 1:11 PM
    i got 0 value from reponse retrofit with kotlin i created a POST from android (FrontEnd) into PHP/MySQL (BackEnd). it did insert the datas into my MySql, but why my object return has 0 value ?

    https://i.stack.imgur.com/LBp8v.png▾

    eventhough the object is valued

    https://i.stack.imgur.com/Rmpgp.png▾

    my dataclas : package com.example.crmclient.model data class TheHisto( var IdJob : Int, var HeureTache : Int ) My service : package...
  • u

    user

    06/22/2022, 2:11 PM
    Room @Relation annotation with a One To Many relationship I have a POJO I'd like to get from the database which has a list of POJO's as a property. This, according to docs is doable via a @Relationship annotation. However, it's a one to many relationship where I don't directly reference the table/entity in question. How would I go about getting this back from the DB directly from the DAO? Is this even possible, or do I have to implement some intermediary binding logic manually? The POJO I'd like to get from DB: data class Chore( var name:...
  • u

    user

    06/22/2022, 2:11 PM
    How can I fetch WhatsApp seen and Unseen statuses in my App in Android? I want to fetch WhatsApp All statuses which are either seen or Unseen in my Android App. I am able to load and show Only those WhatsApp statuses which are already seen, but the problem is that I am unable to load and show those statuses which are Unseen by user. Is there any way to load WhatsApp Unseen Statuses in Android App? Thanks
  • u

    user

    06/22/2022, 2:51 PM
    Need guidance with bottom_navigation and it Hello I'm new to learning kotlin and trying to make an app as well as following a tutorial. But no matter what video I watch I always get an error for both bottom_navigation and it. Can anyone have a look at my code and possibly help me figure why theres an error. Thank you for any input :) Main Activity.ktl package com.example.myapplication import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import androidx.fragment.app.Fragment import...
  • u

    user

    06/22/2022, 3:11 PM
    Using spanSizeLookup in Kotlin to set span size based on ItemViewType in GridLayoutManager I have a a RecyclerView that uses GridLayoutManager to display data, I'm trying to span an item fully if the ItemViewType matches being a title. I know how its done in java, but in Kotlin I cant get the override method that returns the position of the item to determine its type. layoutManager = new GridLayoutManager(context, 2); layoutManager .setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() { @Override public int getSpanSize(int position) { switch...
  • u

    user

    06/22/2022, 3:31 PM
    recyclerview Drag and drop to different View I have a recyclerview in my project, where a user will be able to drag and drop it to a different view(card view). I am following mvvm pattern and using dataBinding. I use the longclick function from within the activity,i created an interface in adapter class for this. inorder to use the drag and drop i need to get the adapter position of the item in activity, which i am unable to get. here is the adapter class class StatementAdapter( private val context: Context, private val...
  • u

    user

    06/22/2022, 3:31 PM
    Getting all elements null on converting of JSON to OBJECT The issue I'm getting: All elements are null way I'm using
    THis jsonFileString is basically the json file response
    val jsonFileString="[{"time": "0min_2sec","sentence": "The first words I spoke in the original phonograph."},{"time": "0min_7sec", "sentence": "A little piece of practical poetry."},{"time": "0min_10sec","sentence": "Mary had a little lamb, its fleece was white as snow."},{"time": "0min_14sec","sentence": "And everywhere that Mary went, the lamb was sure to go."}]" val gson =...
  • u

    user

    06/22/2022, 3:51 PM
    I want to subtract a Calendar from another Calendar in Android // Entry Date val entryDate: Date? = SimpleDateFormat("dd MM yyyy", Locale.getDefault()).parse(users[position].entryDate!!) val entryDateC: Calendar = Calendar.getInstance() entryDateC.time = entryDate!! Log.e("a7a entry" ,"$entryDate") val endDateC: Calendar = Calendar.getInstance() endDateC.time = entryDate when (users[position].userSubscriptionPeriod) { "1 Month" -> { endDateC.add(Calendar.MONTH, 1)} "3...
  • u

    user

    06/22/2022, 4:11 PM
    Create two activities with different home fragment and my bottom navigation didnt navigate when item is clicked I create two activities as a navcontroller for the fragment, i dont know is this good or not. For MyActivity, the bottom navigation is worked well and showing the fragment. But for the MainActivityRelawan the Home Menu didnt navigate when item clicked and the fragment only will be showed after i press back button, i dont know why. In the main_activity for control the Main Activity Fragment, and main_activity_relawan to control Main Activity Relawan Fragment. This is my MainActivityRelawan...
  • u

    user

    06/22/2022, 4:51 PM
    Google Play Signing: is it a problem to enroll several apps signed with the same key? I have on Google Play several apps in production. Until now, I don't use Google Play Signing. As it seems that Google Play Signing is great for security and to reduce the size of the delivered apk, I would like to enroll all my apps. The problem is that I historically always signed all of them with the same key (same keystore, same alias). I wonder if it will be a problem for the Google Play Console. Once I enrolled one app, will I be unable to enroll the other apps? I am afraid to receive a...
  • u

    user

    06/22/2022, 4:51 PM
    Android 12 reading file on Internal storage leads to "open failed: EACCES (Permission denied)" after hours of headache and researching (even the second site of google :) ), I decided to ask here for a solution to my problem. What I'm trying to do is reading a Keepass File from my Internal Storage. The file is located under "/storage/emulated/0/Keepass". The file has to remain there, because it automatically syncs with a SynologyNAS. When im trying to open the file with the absolute path, I get the exception W/System.err: java.lang.IllegalArgumentException: The KeePass database file...
  • u

    user

    06/22/2022, 5:11 PM
    Swig Error when using C functions in Kotlin - two different errors I am using the following command using swig: swig -c++ -java -includeall -package onescream.onescream compute_feature_set.i The interface file is: /* compute_feature_set.i */ %module compute_feature_set %{ /* Includes the header in the wrapper code */ #include "compute_feature_set.h" %} /* Parse the header file to generate wrappers */ %include "compute_feature_set.h" I get the following errors: compute_feature_set.h:17: Error: Unable to find 'stddef.h' compute_feature_set.h:18: Error:...
  • u

    user

    06/22/2022, 5:31 PM
    How can I insert data into a table automatically based on the option checked in a radiogroup? - Android Studio I'm doing a project in Android Studio and I'm having trouble inserting records into two of the tables. The idea is to first insert data in one of the tables (LibrosTotales) and according to the option chosen in a RadioGroup,is inserted into one table or another (LibrosLeídos and LibrosPendientes). Although the registration in the main table is successful but in the other two it does not occur. I've checked it through some rawQuery to see if there are any logs. Don't know if the problem is in...
  • u

    user

    06/22/2022, 5:31 PM
    Is it better to learn kotlin or javascript and flutter? [closed] I've learned html&css and I want to be able to code for front-end, back-end and multiplatform. should I use kotlin for all of that or should I learn flutter for multiplatform and javascript(react, svelte, node) for web.
  • u

    user

    06/22/2022, 6:11 PM
    How to return a variable inside a addOnSuccessListener? [duplicate] I'm using Google Places API and I want to return a Place Object out of my func but it is executed asynchronously. That's my code:

    Code with asynchronous func▾

    Here you can see the logs:

    Logs▾

    As you can see the variable don't get the returned values. So my question is: How can I return "response.place" out of the func?
  • u

    user

    06/22/2022, 6:31 PM
    realm shows only one item from arryList kotlin I'm using realm in my app to save some ArrayList data API, but realm only saves one Item from the data and displays it, it should save all the items not only one. here's my code for the classes. Realm Model @RealmClass open class Images( @PrimaryKey var id: Int? = 0, var imageUrl: String? = "" ) : RealmObject() My Fragment class ImagesWallpaperFragment : Fragment() { // realm private lateinit var realm: Realm private lateinit var wallpapersList: ArrayList private fun intiRealm() {...
  • u

    user

    06/22/2022, 6:51 PM
    Run errors - Plugins depricated versions The plugins flutter_geocoder, flutter_webview_plugin use a deprecated version of the Android embedding. To avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them since a future release of Flutter will remove these deprecated APIs. If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: <a href="https://flutter.dev/go/android-plugin-migration"...
  • u

    user

    06/22/2022, 6:51 PM
    How to probably handle websocket call back in kotlin? This is my first time dealing with web sockets I have a websocket connection using okhttp inside a WebSocketManager class I also have a listener that extends WebSocketListener that is passed to this connection for call backs, this websocket listener overrides few methods one of them is override fun onMessage(webSocket: WebSocket, text: String) {} What is the proper way to share this data from the manager class with the compose screen? what I did was that inside this manager class (which I...
  • u

    user

    06/22/2022, 7:31 PM
    How to show nearby users in search results from firebase firestore database using kotlin Android? Database is firebase firestore. I want to show the result of nearby user list to other users who search on my app. Kindly help, I am new to Android development and I m learning on my own and I am not college student.
  • u

    user

    06/22/2022, 7:31 PM
    Running gradlew Corrupts Cache I have a kotlin project (compiling to java byte code) that works fine. I can build and run via IntelliJ. However as soon as I go to the command line and run gradlew clean or gradlew build in the project top level directory on the command line (windows), I get the following error: e: java.lang.NoClassDefFoundError: Could not initialize class org.jetbrains.kotlin.com.intellij.pom.java.LanguageLevel at...
  • u

    user

    06/22/2022, 7:31 PM
    How to manually destroy or recreate a ViewModel Working on an Android app where each user can have multiple accounts under the same login. There is a single activity with a fragment per tab - based on the Android sample Bottom Navigation. On one of the tabs is a calendar, which is hooked up to a ViewModel like so: override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View { val calendarViewModel =...
  • u

    user

    06/22/2022, 7:31 PM
    Use Jetbrains Exposed DAO entity multiple times in Kotlin I'm trying to access an exposed entity from my H2 database multiple times. This is my code: val room = getRoom(event.roomId) println(room.roomId) println(room.data) where getRoom is the following function: fun getRoom(roomId: RoomId): Room { return transaction { Rooms.insertIgnore { it[id] = roomId.full } return@transaction Room[roomId.full] } } and this is my Room Entity class Room(pRoomId: EntityID) : Entity(pRoomId) { companion object :...
  • u

    user

    06/22/2022, 9:31 PM
    WebView not scrolling I have a webview in NestedScrollView on screen. Also I have recycle view below the screen, and when recycle view items closes webview, i scroll up to see the webview again, at that point the content of the webview stops scrolling. How I can fix it? @SuppressLint("SetJavaScriptEnabled", "JavascriptInterface") private fun initWebView() { web.let { with(it.settings) { javaScriptEnabled = true userAgentString =...
  • u

    user

    06/22/2022, 9:51 PM
    Adapter in Fragment not updating when the data changes in the viewModel from an action in Main Activity I have a room database where I have songs associated with artists and when I change artist from the Main Activity overflow menu, the fragment with the recyclerview showing a list of songs doesn't update unless I navigate away from the fragment and back again. I thought my observing of the list was sufficient because it worked for other changes being made but not this time. How do I get it to update with the new artist's songs when data changes? songViewModel //default artist name for this...
  • u

    user

    06/22/2022, 10:31 PM
    How I can get Hardware Information in Android app I want to get information about a device such as RAM (mem size), GPU (model, mem size), CPU (model, count of cores) programmatically in android app(kotlin). I found some similar posts (for example that), but there is no solution there. Help me please
  • u

    user

    06/22/2022, 10:31 PM
    Размер фотографии перед отправкой выше чем после The application has the ability to take a photo and upload it to the server. When using the main camera, there are no problems. When using the front one, the size and quality of the photo before sending is much lower than after. For example: frontal: original on the device: 365 kb, 1600 by 1200 px, received on the server: 137 kb, 480 by 618 px. main: original on the device: 1 mb, 2560 by 1440 px, came to the server: 2.3 mb, 1392 by 2576 px. That is, somehow the size and quality is reduced....
  • u

    user

    06/22/2022, 10:51 PM
    Variable 'result' must be initialized I INITIALLY INITIALIZED RESULT IN THE BEGINNING OF THE OVERRIDE FUN doInBackground() but during the return result it is showing that (Variable 'result' must be initialized) in the android studio its showing underline red mark under the return result. this code in in kotlin i am writing this because stack overflow showing this to me here is the code package shubham.lists.simpleapicalldemo import android.app.Dialog import android.os.AsyncTask import androidx.appcompat.app.AppCompatActivity...
  • u

    user

    06/22/2022, 11:31 PM
    Implement FirebaseUI AuthUI with Hilt and MVVM So a few days into learning Kotlin, Android, and MVVM and I'm a little confused on how I'm supposed to handle the authentication flow with com.firebaseui:firebase-ui-auth:8.0.1 At the moment I have a AuthRepository which with my understanding should be responsible for calling to Firebase. So I have the following code: class AuthRepositoryImpl( private val auth: FirebaseAuth, private val authUI: AuthUI, ) : AuthRepository { override fun loginUser(result: (UiState) -> Unit) {...
  • u

    user

    06/23/2022, 2:31 AM
    Pre-packaged database has an invalid schema KOTLIN - BUT the expected and found are same I have uninstalled and installed app again each time but no luck. Can you please help

    The Contents are same▾

Powered by Linen
Title
u

user

06/23/2022, 2:31 AM
Pre-packaged database has an invalid schema KOTLIN - BUT the expected and found are same I have uninstalled and installed app again each time but no luck. Can you please help

The Contents are same▾

View count: 10