When I use ViewModel.Factory, appear `Kodein No binding found for bind()` errorR cannot be resolved - Android error'Must Override a Superclass Method' Errors after importing a project into Eclipse“Debug certificate expired” error in Eclipse Android pluginsHow do I fix “Failed to sync vcpu reg” error?LogCat message: The Google Play services resources were not found. Check your project configuration to ensure that the resources are includedError retrieving parent for item: No resource found that matches the given name after upgrading to AppCompat v23Warning: This AsyncTask class should be static or leaks might occurAndroid Architecture Components, android binding and LiveDataDagger 2 - two instances of the same View model are createdKotlin Object saving into the Room Database with MVVM Design Pattern using Kodein

RPI3B+: What are the four components below the HDMI connector called?

How would my creatures handle groups without a strong concept of numbers?

Contexte et orthographe du mot « feedback »

What explains 9 speed cassettes price differences?

US Civil War story: man hanged from a bridge

What's the point of having a RAID 1 configuration over incremental backups to a secondary drive?

How to loop for 3 times in bash script when docker push fails?

Why isn't there research to build a standard lunar, or Martian mobility platform?

Is there any word for "disobedience to God"?

Why isn't pressure filtration popular compared to vacuum filtration?

Optimization terminology: "Exact" v. "Approximate"

Received a dinner invitation through my employer's email, is it ok to attend?

How can I get a player to accept that they should stop trying to pull stunts without thinking them through first?

Print the last, middle and first character of your code

Why did Harry Potter get a bedroom?

Is anyone advocating the promotion of homosexuality in UK schools?

Why presheaves are generalized objects?

Shortest hex dumping program

Why are they 'nude photos'?

Is a 10th-level Transmutation wizard considered a shapechanger for the purpose of effects such as Moonbeam?

Do I have a right to cancel a purchase of foreign currency in the UK?

How to properly say "bail on somebody" in German?

How were Martello towers supposed to work?

Good resources for solving techniques (Metaheuristics, MILP, CP etc)



When I use ViewModel.Factory, appear `Kodein No binding found for bind()` error


R cannot be resolved - Android error'Must Override a Superclass Method' Errors after importing a project into Eclipse“Debug certificate expired” error in Eclipse Android pluginsHow do I fix “Failed to sync vcpu reg” error?LogCat message: The Google Play services resources were not found. Check your project configuration to ensure that the resources are includedError retrieving parent for item: No resource found that matches the given name after upgrading to AppCompat v23Warning: This AsyncTask class should be static or leaks might occurAndroid Architecture Components, android binding and LiveDataDagger 2 - two instances of the same View model are createdKotlin Object saving into the Room Database with MVVM Design Pattern using Kodein






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I reference to http://kodein.org/Kodein-DI/?6.1/android#view-model-factory use the kodein viewmodel, appeared the error.



the part code



bind<ViewModelProvider.Factory>() with singleton KodeinViewModelFactory(instance()) 


class KodeinViewModelFactory(private val kodein: Kodein) : ViewModelProvider.Factory 

override fun <T : ViewModel> create(modelClass: Class<T>): T =
kodein.direct.Instance(TT(modelClass))










share|improve this question




























    1















    I reference to http://kodein.org/Kodein-DI/?6.1/android#view-model-factory use the kodein viewmodel, appeared the error.



    the part code



    bind<ViewModelProvider.Factory>() with singleton KodeinViewModelFactory(instance()) 


    class KodeinViewModelFactory(private val kodein: Kodein) : ViewModelProvider.Factory 

    override fun <T : ViewModel> create(modelClass: Class<T>): T =
    kodein.direct.Instance(TT(modelClass))










    share|improve this question
























      1












      1








      1








      I reference to http://kodein.org/Kodein-DI/?6.1/android#view-model-factory use the kodein viewmodel, appeared the error.



      the part code



      bind<ViewModelProvider.Factory>() with singleton KodeinViewModelFactory(instance()) 


      class KodeinViewModelFactory(private val kodein: Kodein) : ViewModelProvider.Factory 

      override fun <T : ViewModel> create(modelClass: Class<T>): T =
      kodein.direct.Instance(TT(modelClass))










      share|improve this question














      I reference to http://kodein.org/Kodein-DI/?6.1/android#view-model-factory use the kodein viewmodel, appeared the error.



      the part code



      bind<ViewModelProvider.Factory>() with singleton KodeinViewModelFactory(instance()) 


      class KodeinViewModelFactory(private val kodein: Kodein) : ViewModelProvider.Factory 

      override fun <T : ViewModel> create(modelClass: Class<T>): T =
      kodein.direct.Instance(TT(modelClass))







      android kodein






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 26 at 2:14









      Jie XuJie Xu

      687 bronze badges




      687 bronze badges






















          1 Answer
          1






          active

          oldest

          votes


















          1














          It's quite simple, you just need to directly transfer Kodein to the factory, without instance()



          class KodeinApp : Application(), KodeinAware 
          override val kodein by Kodein.lazy
          import(androidXModule(this@KodeinApp))
          bind() from singleton KodeinViewModelFactory(kodein)
          bind() from singleton MyViewModel(kodein)







          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55348908%2fwhen-i-use-viewmodel-factory-appear-kodein-no-binding-found-for-bindkodein%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            It's quite simple, you just need to directly transfer Kodein to the factory, without instance()



            class KodeinApp : Application(), KodeinAware 
            override val kodein by Kodein.lazy
            import(androidXModule(this@KodeinApp))
            bind() from singleton KodeinViewModelFactory(kodein)
            bind() from singleton MyViewModel(kodein)







            share|improve this answer



























              1














              It's quite simple, you just need to directly transfer Kodein to the factory, without instance()



              class KodeinApp : Application(), KodeinAware 
              override val kodein by Kodein.lazy
              import(androidXModule(this@KodeinApp))
              bind() from singleton KodeinViewModelFactory(kodein)
              bind() from singleton MyViewModel(kodein)







              share|improve this answer

























                1












                1








                1







                It's quite simple, you just need to directly transfer Kodein to the factory, without instance()



                class KodeinApp : Application(), KodeinAware 
                override val kodein by Kodein.lazy
                import(androidXModule(this@KodeinApp))
                bind() from singleton KodeinViewModelFactory(kodein)
                bind() from singleton MyViewModel(kodein)







                share|improve this answer













                It's quite simple, you just need to directly transfer Kodein to the factory, without instance()



                class KodeinApp : Application(), KodeinAware 
                override val kodein by Kodein.lazy
                import(androidXModule(this@KodeinApp))
                bind() from singleton KodeinViewModelFactory(kodein)
                bind() from singleton MyViewModel(kodein)








                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jun 22 at 17:40









                Ivan TIvan T

                1495 bronze badges




                1495 bronze badges


















                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55348908%2fwhen-i-use-viewmodel-factory-appear-kodein-no-binding-found-for-bindkodein%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현