本文介绍了可以将动态壁纸被链接到一个应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的动态壁纸。是否有可能一个动态壁纸链接到与它自己的引擎的应用程序?我的意思是,要避免使用典型的动态壁纸设置里选择项目的数量(主要才对XD),你在想墙纸。我想有我自己的应用程序来管理动态壁纸的内容。请问可不可以?如果答案是肯定的,我是有帮助的,如果你告诉我该怎么做。

i'm new at live wallpapers. Is it possible to link a live wallpaper to an app with it's own engine? I mean, to avoid using the typical "Live wallpapers settings" where you choose the amount of items (mostly fishes xD), that you want in the wallpaper. I'd like to have my own app to manage the content of the live wallpaper. Would that be possible? If answer is yes, i'd be helpful if you told me how to do it.

推荐答案

我不认为Hackbod明白你的问题。如果要放置在应用,而在动态壁纸preVIEW的preferences按钮动态壁纸设置,你可以做到这一点。

I don't think Hackbod understood your question. If you want to place your live wallpaper settings in an app instead of in the preferences button on live wallpaper preview, you can do that.

首先,你必须将你的应用程序是一个动态壁纸,并在同一时间一个普通的应用程序。所以,你的表现应该具备以下两个部分:

First, you must set your application to be a live wallpaper and a regular application at same time. So your manifest should have these two parts:

<activity ...>
    <intent-filter >
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity> 

<service android:name="..." android:permission="android.permission.BIND_WALLPAPER">
    <intent-filter android:priority="1">
        <action android:name="android.service.wallpaper.WallpaperService" />
    </intent-filter>
    ....
</service>

二,你要坚持你的应用程序做用户设置的改变(你可以使用共享preferences)和你的WallpaperService.Engine回调(如onVisibilityChanged或任何有意义的你)更新您的动态壁纸的行为。

Second you should persist user settings changes made in your app (you can use SharedPreferences) and update your live wallpaper behavior on your WallpaperService.Engine callbacks (like onVisibilityChanged or whatever makes sense for you).

这篇关于可以将动态壁纸被链接到一个应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 19:15