Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hello, How do you pass an activity into a MovieRepository? #17

Open
i91h1r opened this issue Apr 11, 2018 · 2 comments
Open

hello, How do you pass an activity into a MovieRepository? #17

i91h1r opened this issue Apr 11, 2018 · 2 comments

Comments

@i91h1r
Copy link

i91h1r commented Apr 11, 2018

for example:
I need to use activity in MovieRepository ,so how can I inject activity to MovieRepository?

@Inject
public MovieRepository(MovieDetailActivity movieDetailActivity,MovieDao movieDao, MovieDBService movieDBService) {
this.movieDao = movieDao;
this.movieDBService = movieDBService;
}

can you write a example in the project ? thinks

@basel93natour
Copy link

you are not supposed to pass activity to repository in this case you are breaking the concept of MVVM

@chiftenj
Copy link

chiftenj commented May 3, 2020

@hyr0318
you should use ViewModel to interact with repository layer, passing activity into repository violated mvvm principles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants