redrield
05/28/2017, 4:50 PMitem
in the model in my App is nulledvin
05/28/2017, 4:51 PMimage.png▾
edvin
05/28/2017, 4:52 PMIRCApp
class I provided 🙂edvin
05/28/2017, 4:52 PMIRCApp
class as your startingpoint.edvin
05/28/2017, 4:53 PMedvin
05/28/2017, 4:53 PMedvin
05/28/2017, 4:54 PMonCommit
function of the ViewModel.redrield
05/28/2017, 4:54 PMredrield
05/28/2017, 4:54 PMredrield
05/28/2017, 4:54 PMedvin
05/28/2017, 4:55 PMedvin
05/28/2017, 4:55 PMredrield
05/28/2017, 4:55 PMedvin
05/28/2017, 4:56 PMedvin
05/28/2017, 5:01 PMsuper.stop()
before you disconnect. That's problematic, because super.stop()
actually cleans up the injection scope, so when you then ask for an IRCClient
below it, you'll get a fresh new instance. Move super.stop()
to the bottom and you should be golden 🙂redrield
05/28/2017, 5:02 PMredrield
05/28/2017, 5:02 PMedvin
05/28/2017, 5:03 PMch
variable in IRCClient
. If you didn't connect, it would be uninitialized, and you'll get a nasty error on disconnect. It's probably better to define it as var ch: Channel?
. Then you can (must) do the null checks, and that will help you to handle the disconnect and avoid the error 🙂edvin
05/28/2017, 5:03 PMedvin
05/28/2017, 5:04 PMredrield
05/28/2017, 5:58 PMedvin
05/28/2017, 6:00 PMleft(MyFragment::class)
redrield
05/28/2017, 6:01 PMredrield
05/28/2017, 6:01 PMedvin
05/28/2017, 6:13 PMby param
and send the parameters into the fragment when you find
them.edvin
05/28/2017, 6:14 PMedvin
05/28/2017, 6:16 PMleft { add(myFragmentInstance) }
if you have already instantiated it.edvin
05/28/2017, 6:16 PMleft = myFragment.root
if you like. I think that looks uglier though.redrield
05/28/2017, 6:26 PM