Search code examples
androidandroid-studiovideochromecast

Make a Chromecast Mini Controller sticky


We have created a video app for Android and we have also connected it with the Chromecast library. We created a Mini Controller in the notification bar and lock screen using this exact code here.

Problem: the Mini Controller can be dismissed as a regular notification instead staying sticky, like the Mini Controller in the YouTube app.

I have found how to make a sticky regular notification, but not how to alter the one given in the Chromecast Docs.


Solution

  • You are probably using deprecated SDK version (v2?) in which the notification is not sticky. If you do casting using the new Cast SDK (Cast Application Framework (CAF)), the notification will be sticky automatically.