简体   繁体   中英

Add DayDream (screen saver) for Android TV to exists Android project

I'm trying to add Android TV support to an existing Android project I have, specifically adding Day Dream service to show a screen saver.

I've seems to add all the required things for the app to run on Android TV and I can even see my Dream Service under Screen Saver in settings but when I select it - it is not selected and under Screen saver, there is no name.

Any ideas what I've might be missing?

I've found a 3 years-old example for Android TV DayDream and in there was my missing piece : In the manifest, under the service description I had to add android:permission="android.permission.BIND_DREAM_SERVICE" .

Full service XML piece:

    <service
        android:name=".bouncer.BouncerDreamService"
        android:exported="true"
        android:label="Bouncing Logo"
        android:permission="android.permission.BIND_DREAM_SERVICE">
        <intent-filter>
            <category android:name="android.intent.category.DEFAULT" />
            <action android:name="android.service.dreams.DreamService" />
        </intent-filter>
    </service>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM