iammert/AndroidArchitecture

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

i91h1r opened this issue · 2 comments

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

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

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