aartikov / Alligator

Alligator is Android navigation library that will help to organize your navigation code in clean and testable way.
MIT License
298 stars 17 forks source link

screenResolver.getScreen() returns null #25

Closed Aissa-H closed 5 years ago

Aissa-H commented 5 years ago

Hi 👋,

Thank you for this great lib!

I have a problem when I try to get a the current activity Screen in the onCreate() of it. The screenResolver returns a null for the .getScreen() call curiously.

I have registered my Activity and it's corresponding Screen in the NavigationFactory.

Here is my Activity and Screen declaration :

class LoginActivity : BaseActivity() {
...
data class Screen(
        val myString: String? = null
    ): me.aartikov.alligator.Screen, Serializable
}
override fun onCreate(savedInstanceState: Bundle?) {
     screenResolver.getScreen(this) //returns null
}

Note that because I haven't migrate my app to AndroidX, I am currently on the version 2.2.0. That's why the #16 issue didn't help me a lot for the moment.

Have you any suggestion for me ?

Thank you in advance 👍

aartikov commented 5 years ago

Do you use Navigator to start this screen?

Aissa-H commented 5 years ago

No, I don't, it's my LAUNCHER Activity

Aissa-H commented 5 years ago

I think I got my answer : Screens are not instantiated for Activities that are launched by the system right ?

aartikov commented 5 years ago

Yes, correct.