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
android
  • s

    Shivam Dhuria

    03/18/2022, 9:05 PM
    Hey guys, I want to run
    debounce
    on a flow from within a Composable. I get this warning Flow operator functions should not be invoked within composition . I am not using Viewmodels so can’t run the flow operator in the VM. Ideally I’d just want to call
    debounce
    on the
    fullNameFlow
    and trigger some changes in the composable. What’s the best way to go forward?
    //This is inside a Composable
    val fullNameFlow = MutableStateFlow("")
    fullNameFlow.debounce(3000).mapLatest {
        Log.i(TAG,it)
        //Change Composable State
    }
    
    FormTextField(
        onValueChange = {
            fullNameFlow.value = it
        }
    )
    p
    z
    • 3
    • 5
  • c

    Conrad Kramer

    03/21/2022, 12:56 AM
    What is the best way to include a given class only in debug compiles? For example, a mock object for the purpose of
    @Preview
    ?
    :not-kotlin: 3
    e
    • 2
    • 2
  • a

    Android75

    03/21/2022, 7:02 AM
    Hi i have two long operation.. and i’d like launch in parallel…
    customScope.launch{
    action1()
    action2()
    i’d like launch in parallel and when 2 methods end your action i have to invoke a method
    r
    p
    • 3
    • 8
  • n

    Nicolai

    03/21/2022, 10:06 AM
    Hi 👋 , I hope that one of you can be of help to me with my current issue 🙏 I have created a BaseViewModel that two different ViewModels VM1 and VM2 extend in hopes of sharing data and some functions used in both places.
    abstract class OnboardingBaseViewModel(
        private val postNotificationSchemeUseCase: PostNotificationSchemeUseCase,
        private val putUserPropertyUseCase: PutUserPropertyUseCase
    ) : ViewModel() {
        // Data that needs to be shared 
        val _customOptionItems = MutableLiveData<List<CustomOptionItem>>()
        val customOptionItems = _customOptionItems
    }
    Upon my init function in VM1 I want to access the data already set from VM2 however it's null. VM2 is created like this:
    @HiltViewModel
    class RemindersTimeViewModel @Inject constructor(
        postNotificationSchemeUseCase: PostNotificationSchemeUseCase,
        putUserPropertyUseCase: PutUserPropertyUseCase
    ) : OnboardingBaseViewModel(postNotificationSchemeUseCase, putUserPropertyUseCase)
    {
    init{
    // this is null - but why?
    val data = customOptionsItems.value
    }
    }
    I inject the viewmodels into the fragments with Hilt like so:
    private val viewModel: RemindersViewModel by activityViewModels()
    a
    p
    • 3
    • 3
  • s

    Slackbot

    03/21/2022, 12:31 PM
    This message was deleted.
    t
    • 2
    • 1
  • v

    Viktor Vostrikov

    03/21/2022, 2:51 PM
    iDenfy uses Jetpack Compose in our production SDK. We’ve created an article about using Jetpack Compose to make custom UI for clients. Read & spread the adoption! 🚀 https://medium.com/idenfy/fully-customizable-jetpack-compose-8c8abaf93137
    🙌 1
    p
    • 2
    • 2
  • a

    andodeki

    03/21/2022, 10:11 PM
    hey guys why is this snippet givving an error in viewModel() section:
    composable(route = Screen.GetQuote.route) { navBackStackEntry ->
                val factory = HiltViewModelFactory(LocalContext.current, navBackStackEntry)
                val viewModel: GetQuoteListViewModel = viewModel("GetQuoteListViewModel", factory)
    //            val viewModel: GetQuoteListViewModel = viewModel()
                GetQuoteScreen(
                    state = viewModel.state.value,
                    onClickHome = {
                        navController.navigate("${Screen.Home.route}")
                    },
                )
            }
    i
    • 2
    • 7
  • c

    Chethan

    03/22/2022, 4:22 AM
    Does it make huge difference between these two version ?
    displayCardList.filter { it.targetGrades?.contains(userGrade) == true }.run {
        return this.toMutableList().also {
            it.add(
                AmbientCardInfo(
                    id = System.currentTimeMillis().toString(),
                    cardType = CardType.GREETING.value,
                    targetGrades = String.EMPTY
                )
            )
        }
    }
    V/S
    return displayCardList
          .filter { it.targetGrades?.contains(userGrade) == true }
          .toMutableList()
          .also { 
              it.add(
                                AmbientCardInfo(
                                    id = System.currentTimeMillis().toString(),
                                    cardType = CardType.GREETING.value,
                                    targetGrades = String.EMPTY
                                )
                            )
           }
    l
    • 2
    • 1
  • a

    azabost

    03/22/2022, 8:07 AM
    Hey 👋 I’m migrating from Gradle 6.x to 7.x and from Android Gradle Plugin 4.x to 7.x so I’m trying to configure Java 11 target in my Gradle setup (following this description). My setup involves using some helper functions in
    buildSrc
    directory so I’m skipping that part. In the end, what I’m calling (or at least I should be calling) is simply:
    android {
        val javaVersion: JavaVersion = JavaVersion.VERSION_11
    
        compileOptions {
            sourceCompatibility = javaVersion
            targetCompatibility = javaVersion
        }
    
        kotlinOptions {
            jvmTarget = javaVersion.toString()
        }
    }
    Nevertheless, I’m still seeing a lot of build warnings:
    'compileJava' task (current target is 11) and 'compileKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.
    Does anyone have any idea if I’m doing something wrong?
    • 1
    • 1
  • t

    the great warrior

    03/22/2022, 8:56 PM
    Hi guys , I'm trying to do a complex task in my function using coroutines. My code looks bad and my app is slow. Here is my task: 1-get the new place item that is added from database. / 2.make it selected / 3. get the last other items from database / 4. make them unselected. is there a better way to this?
    fun checkNewItemAdded(item: PlaceItem) {
        viewModelScope.launch {
            withContext(<http://Dispatchers.IO|Dispatchers.IO>) {
                val newItemAdded = async { getPlaceItem(item.id) }
                val placeItem = newItemAdded.await()
                placeItem?.let {
                        if (!it.isChecked) {
                        it.isChecked = true
                        val checkNewItem = async { update(it) }
                            checkNewItem.await()
                            val getAllPlaces = async { getPlaces() }
                            val places = getAllPlaces.await()
                            val runningTasks = places.map { place ->
                                async {
                                    val singlePlaceItem = getPlaceItem(place.id)
                                    place to singlePlaceItem
                                }
                            }
                            val responses = runningTasks.awaitAll()
                            responses.forEach { (place, response) ->
                                if (response != placeItem) {
                                    places.find { it.id == place.id }?.isChecked = false
                                    update(place)
                                }
                            }
                 }
                }
           }
        }
    }
    z
    • 2
    • 3
  • r

    Ryli Davis

    03/22/2022, 11:23 PM
    Hi, I'm working on a simple Apollo Kotlin graphql and a bit of a beginner. I am just trying to get a request for my query but I keep getting 400 errors from Apollo. This is my code for FirstFragment.kt where I'm trying to execute the query in some way.
    package com.example.animod
    import android.os.Bundle
    import android.util.Log
    import androidx.fragment.app.Fragment
    import android.view.LayoutInflater
    import android.view.View
    import android.view.ViewGroup
    import androidx.lifecycle.lifecycleScope
    import com.apollographql.apollo3.api.Optional
    import com.example.aniMod.CharacterQuery
    import com.example.animod.databinding.FragmentFirstBinding
    
    
    
    /**
     * A simple [Fragment] subclass as the default destination in the navigation.
     */
    class FirstFragment : Fragment() {
    
      var _binding: FragmentFirstBinding? = null
    
        // This property is only valid between onCreateView and
        // onDestroyView.
         val binding get() = _binding!!
    
    
        override fun onCreateView(
            inflater: LayoutInflater,
            container: ViewGroup?,
            savedInstanceState: Bundle?
        ): View {
            _binding = FragmentFirstBinding.inflate(inflater)
            return binding.root
    
    
        }
    
    
        override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
            super.onViewCreated(view, savedInstanceState)
    
            lifecycleScope.launchWhenResumed {
                val response = apolloClient.query(CharacterQuery(search =  Optional.Present<String>(""))).execute()
                Log.d("Anime Character Picture", "Success ${response.data}")
            }
        }
    
    
    }
    And this is my PictureQuery.kt file
    query Character($search: String) {
        person: Character(search: $search) {
            image {
                large
            }
        }
    }
    I appreciate any help . Thank you
    b
    • 2
    • 1
  • v

    Vivek Modi

    03/23/2022, 11:34 AM
    Hey can someone explain what is the use of
    @Retention(AnnotationRetention.BINARY)
    What is
    Retention
    ,
    AnnotationRetention
    and
    BINARY
    ?
    z
    • 2
    • 5
  • a

    Aaron Waller

    03/24/2022, 11:36 AM
    Hey guys, how do I get an expert in Kotlin and android development? I think I know enough to develop basic apps with basic features, now I want to get to the next level and really dive into complex programming. For example I would like to create my own photo editor app. I have the feeling that there are no resources to such things online. Or am I just too bad in Googling? How would go start this journey? Before I always learned with Blog Posts, YouTube Videos and Raywenderlich or Udemy Courses. But for such topics there are no resources _/
    f
    c
    r
    • 4
    • 10
  • d

    dead.fish

    03/25/2022, 8:10 AM
    Hi all, so what are my options when it comes to disk-based LRU cache implementations? There is the old one (https://github.com/JakeWharton/DiskLruCache) from Jake (originally from Google apparently), written in Java, which is basically discontinued, then there is this one (https://github.com/solkin/disk-lru-cache) which looks promising at first, but has bad test coverage, and finally OkHttp comes with one (https://github.com/square/okhttp/blob/master/okhttp/src/jvmMain/kotlin/okhttp3/internal/cache/DiskLruCache.kt), clearly based on Jake’s / Google’s, but in Kotlin, with quite a few inner dependencies to things from OkHttp itself. Tried to extract the latter and ended up with 3000+ LOC including tests (without OkHttp’s
    TaskRunner
    setup, but
    Coroutines
    for cleanup handling), which made some tests fail and overall made me feel I was doing something wrong (don’t want to import so many LOC in my tree).
    👀 1
    m
    • 2
    • 1
  • b

    brian

    03/25/2022, 2:29 PM
    How can I run the println function in init and still use the delegate in the fragment?
    :thread-please: 1
    s
    a
    +2
    • 5
    • 6
  • t

    Tariyel Islami

    03/25/2022, 5:45 PM
    Hi guys, I wrote simple code to passing any of type for navigate between screens.
    object Transformer {
        private var transformerMap = mutableMapOf<String, Any>()
    
        fun put(key: String, t: Any) {
            transformerMap[key] = t
        }
    
        fun pull(key: String): Any {
            return transformerMap[key]!!
        }
    }
    The logic is simple, When you use the navigate function you have to put the parameters which you want to send Where you use the Composable function, you need to pull it and give it as a parameter. It is perfectly working. I am wondering that is this wrong way ?
    z
    c
    • 3
    • 4
  • t

    the great warrior

    03/25/2022, 9:03 PM
    is there any to convert name of a city to latitude and longitude ?
    :yes: 3
    :not-kotlin: 6
    u
    • 2
    • 2
  • a

    Aaron Waller

    03/26/2022, 11:40 AM
    Hello guys, what are your favorite open source MVVM + Jetpack Compose projects? I currently try to look into different projects to find new smart ways to do things and to learn some new kotlin syntax
    t
    • 2
    • 1
  • t

    Tariyel Islami

    03/27/2022, 10:08 AM
    Hi guys, Can someone explain “Hilt and Dagger” to me? I seem to understand the event, but in my not fully enlightened mind, I specifically want to know where, why and when to use it. Thanks everyone in advance🙏
    :not-kotlin: 3
    👍 1
    v
    • 2
    • 1
  • s

    spierce7

    03/27/2022, 6:02 PM
    When is Kotlin 1.7 expected? May right?
    p
    • 2
    • 7
  • a

    Aaron Waller

    03/28/2022, 4:16 AM
    Just a general question about MVVM: Where to put code for IO Operations? I know you shouldn’t put business logic in the UI layer but also no context in the VIewModel. So where to put for example a function to download a file to internal storage? I need the context for that and it also has nothing to do with UI.
    :not-kotlin: 1
    i
    l
    +2
    • 5
    • 8
  • r

    Ritwik Raj Srivastava

    03/28/2022, 6:12 AM
    Hi All, Need a little help with something I have been struggling since days. Lets say I have a Extension function
    fun Any?.toJSONString(): String {
      return this?.let {
        try {
          val gson = GsonBuilder().setPrettyPrinting().create()
          gson.toJson(this)
        } catch (e: Exception) {
          "{}"
        }
      } ?: "{}"
    }
    And I have another Extension function that takes in Generic T and I want to parse/manipulate the result. For example being
    fun <T : Any> Response<MyResponse<T>>.toStr(): String {
      return T.toJSONString()
    }
    I am getting this error
    Type parameter 'T' cannot have or inherit a companion object, so it cannot be on the left hand side of dot
    Please help me out. If anyone can explain the error itself. It will be great. I do not have indepth Kotlin know-hows.
    a
    r
    • 3
    • 5
  • a

    androidexpertmanish

    03/28/2022, 7:10 AM
    Anyone know about any open source maps solution which works on AOSP without GMS?
    :not-kotlin: 4
    z
    x
    m
    • 4
    • 3
  • i

    iamraghavawasthi

    03/29/2022, 6:01 AM
    Hey I need to parse the following date format
    "2021-12-02T16:54:08.931Z"
    I am using the pattern
    "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
    in Simple Date Format. I am getting unparseble date error
    :not-kotlin: 1
    j
    • 2
    • 2
  • o

    Omar Qadour

    03/29/2022, 3:24 PM
    Hello guys, how can i call functions in a certain sequence?. I need the result from the first two functions for the third one. In the first two functions there is networking, so they take "long time" and the third one is executing first 😞 . The attached photo is from the MainActivity. Thank you in advance!
    r
    • 2
    • 1
  • a

    althaf

    03/30/2022, 7:40 AM
    Hi, is there way to simplify this kotlin statement, i don't like it taking multiple iterations
    private fun List<PaymentTaxDiscountDetail.PaymentTaxDiscount>.getTotalTaxDiscount(): Double {
    
        var vatPlusDiscountTotal = sumByDouble {
            if (!it.taxType.startsWith(TaxType.WHT.name)) it.whtAmount else 0.0
        }
    
        val whtTotal = sumByDouble {
            if (it.taxType.startsWith(TaxType.WHT.name)) it.whtAmount else 0.0
        }
        return vatPlusDiscountTotal - whtTotal
    }
    f
    z
    • 3
    • 11
  • a

    Ali

    03/30/2022, 9:30 AM
    Hey guys, I was trying to use on-demand feature of
    ViewStub
    and
    OnInflateListener
    to listen once the original layout is inflated. This is my
    ViewStub
    layout `fragment_navigation_viewstub`:
    <?xml version="1.0" encoding="utf-8"?>
    <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="<http://schemas.android.com/apk/res/android>"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    
        <ViewStub
            android:id="@+id/fragmentNavigationViewStub"
            android:layout="@layout/fragment_navigation"
            android:layout_width="match_parent"
            android:inflatedId="@+id/items_list"
            android:layout_height="match_parent" />
    
    </androidx.constraintlayout.widget.ConstraintLayout>
    and this is my original layout `fragment_navigation`:
    <?xml version="1.0" encoding="utf-8"?>
    <androidx.recyclerview.widget.RecyclerView
        xmlns:android="<http://schemas.android.com/apk/res/android>"
        android:id="@+id/items_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
    and my listeneer inside the fragment:
    private val binding by viewBinding { FragmentNavigationViewstubBinding.inflate(it) }
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding.fragmentNavigationViewStub.setOnInflateListener { _, view ->
            fragmentNavigation = FragmentNavigationBinding.bind(view)
        }
    }
    But I got this exception and looks like
    setOnInflateListener
    is not called
    kotlin.UninitializedPropertyAccessException: lateinit property fragmentNavigation has not been initialized
    :thread-please: 3
    r
    • 2
    • 18
  • a

    Ahmed Shehata

    03/30/2022, 4:06 PM
    How can I add this icon relative to the single character in jetpack compose?
    a
    m
    • 3
    • 2
  • b

    Breaker ACT

    03/30/2022, 4:17 PM
    Did anyone get issue with viewModelScope ?
    viewModelScope.launch
    work like a charm until I’m navigate to other screen => viewModel go to onClear() => Then I’m navigate back and try to call
    viewModelScope.launch
    but it didn’t anything. Any idea for this ?
    c
    t
    • 3
    • 7
  • p

    PontiacGTX

    03/31/2022, 2:10 PM
    Hello I have a small problem whenever I try to start a new intent i have succesfully assigned a variable into a Parcelable object but when I start this new Activity from a fragment it just display a blank screen and the new Activity is not showing up as I expected nor the breakpoint on OnCreate is triggered, what could I do?
    :not-kotlin: 5
    • 1
    • 1
Powered by Linen
Title
p

PontiacGTX

03/31/2022, 2:10 PM
Hello I have a small problem whenever I try to start a new intent i have succesfully assigned a variable into a Parcelable object but when I start this new Activity from a fragment it just display a blank screen and the new Activity is not showing up as I expected nor the breakpoint on OnCreate is triggered, what could I do?
:not-kotlin: 5
here is the method
fun loadImages(){
        recyclerView!!.setHasFixedSize(true)
        recyclerView!!.layoutManager = GridLayoutManager(this.activity,4)

        try {
            this.imageList = ImageGallery.GetImagesList(this.context as Context )
        }
        catch (ex:Exception)
        {
            println(ex.message)
        }

       try { galleryAdapter = GalleryAdapter(this.context as Context,imageList,
           object : IPhotoInterface {
               override fun onPhotoClick(stringPath: String):Unit {
                   //process picture on click
                   imageIntent  = android.content.Intent(context,SecondaryActivity::class.java)
                   imageIntent.putExtra("image_file",File(stringPath))
                   try{
                       startActivity(imageIntent)

                   }catch(except:Exception)
                   {
                       println(except.message)
                   }

               }
           })
           recyclerView?.adapter = galleryAdapter
           galleryNumberText?.text = "${imageList.size} images"
       }
        catch(ex:Exception)
        {
            println(ex.message)
        }
    }
View count: 8