scaloid icon indicating copy to clipboard operation
scaloid copied to clipboard

How to use dependency injection in an activity.

Open SangeetaGulia opened this issue 8 years ago • 2 comments

SangeetaGulia avatar Sep 28 '16 07:09 SangeetaGulia

Would you describe your issue in more detailed?

pocorall avatar Sep 28 '16 08:09 pocorall

I am trying to do it like this : class SomeActivity @Inject()(someActivityHelper: someActivityHelper) extends SActivity with SContext

but when i try to create intent as : val intent = SIntent[SomeActivity]

it gives me error as : Cannot instantiate SomeActivity .... no default contructor found.

I believe it is due to the fact that SomeActivity uses SomeActivityHelper and i am unable to pass it when i create intent.

What can be the possible ways to deal with it? Any help will be appreciated.

SangeetaGulia avatar Sep 28 '16 08:09 SangeetaGulia