jeudi 5 novembre 2015

Multiple views/activities controlling CastButton

If we look at a bunch of Chromecast Apps, we see that the cast button persists across different views/activities. That is, when we connect to chromecast in the main activity, and later enter a videoplayer activity, the cast button is still available.

Programmatically, what is the best design for this desired behavior? All I can think of is to first start detecting the existing chromecast devices available in the main activity, and keep passing this cast button as a parameter to other classes in which we need to show a cast button in. Would this work? or would we essentially have a lot of duplicate code in different classes? How are you guys designing your cast apps with this desired behaviour?

Aucun commentaire:

Enregistrer un commentaire