SpotifyApi icon indicating copy to clipboard operation
SpotifyApi copied to clipboard

Change Application for Context.

Open Wolftein opened this issue 10 years ago • 1 comments

Would you consider changing Application parameter to Context instead?, i'm developing a library that has multiple services (Spotify is one) and using the API enforce me to initialise SpotifyAPI in the application instead of a library.

Wolftein avatar Feb 16 '15 22:02 Wolftein

Sorry for late response...

I don't know all about your library implementation and architecture, but I think you can use Service#getApplication() for initialize SpotifyAPI instance. I want to make sure that SpotifyAPI is available within an Application lifecycle and avoid initializing with Activity or Service context because it is expected that SpotifyAPI instance is a singleton, so we are not planning to replace Application argument type with Context.

KeithYokoma avatar Apr 09 '15 08:04 KeithYokoma