hello, How do you pass an activity into a MovieRepository?
i91h1r opened this issue · 2 comments
i91h1r commented
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 commented
you are not supposed to pass activity to repository in this case you are breaking the concept of MVVM
chiftenj commented
@hyr0318
you should use ViewModel to interact with repository layer, passing activity into repository violated mvvm principles.