Open mkodekar opened 7 years ago
The usual way to handle that use case is to simply use rewriteHistory()
in your Activity's onCreate
.
Also you need to make sure that your Navigator is basically a Singleton (or at least a Singleton within your scope), and that it does not go away when the activity get's rotated.
On can simply use @Singleton and only have one Navigator for the whole app for example.
For example
and the navigator.onCreate() on the injecting activity
and finally when i want to restart an activity after clearing sharedpreference , i might want to go to the loginscreen instead of the basescreen, the normal way without dependency injection works flawlessly where as the dependency injection method launches the Basescreen again.