I've seen this and several other similar questions, and I know the problem and what people are saying is the solution: to use the youtube API, you should use your application context rather than the activity context because of, seemingly, a bug in the youtube API. However, the context must implement OnInitializedListener, and only my activity does that--not my applicationContext.
When I use the line youTubePlayerView.initialize(API_KEY, getApplicationContext());
I get the error Wrong 2nd argument type. Found android.content.Context, required: 'com.google.android.youtube.player.YouTubePlayer.OnInitializedListener'
.
How can I fix this memory leak?