是否可以使用Dagger2注入基於SDK版本的具體實現?Dagger2:可以根據Android版本注入嗎?
例如
// MediaPlayerComponent.class
@Component(modules = {MediaPlayerModule.class}
public interface MediaPlayerComponent
{
void inject(MediaPlayerUI ui)
}
// MediaPlayerUI.java
public class MediaPlayerUI
{
@Inject
public MediaPlayer mPlayer;
}
// GingerbreadMediaPlayer.java
public class GingerbreadMediaPlayer extends MediaPlayer {...}
// IceCreamSandwichMediaPlayer.java
public class IceCreamSandwichMediaPlayer extends MediaPlayer {...}