Android MVP: which layer should store context variable
问题 I find myself where i need to play a sound file when user clicks a button on a view. MediaPlayer requires a context to be created. What is the best way to put MediaPlayer initialization code? Should I pass a context into a presenter method and play it there? Or is it ok to just play on the view. 回答1: Context is a part of Android View Layer in MVP, so Presenter must not have any idea about it and you should not pass it to presenter . You have to add a methods to your View interface and