如何为您的动态壁纸添加图标

发布于 2024-12-05 08:02:10 字数 1377 浏览 0 评论 0原文

我的动态壁纸有一个图标,在安装之前会显示,但是安装后进入壁纸>动态壁纸,里面没有图标,只是一个空的灰色图像。 我的动态壁纸有一个图标,在安装之前会显示,但是安装后进入壁纸>动态壁纸,里面没有图标,只是一个空的灰色图像。

这是我的清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:versionName="1.0" package="com.cutecats.cats" 
    android:versionCode="1">
    <uses-sdk android:minSdkVersion="8" />



    <uses-feature android:name="android.software.live_wallpaper" />
    <application
        android:icon="@drawable/icon" 
        android:label="@string/app_name">
        <service
            android:name=".CubeWallpaper1"
            android:icon="@drawable/icon"
            android:permission="android.permission.BIND_WALLPAPER">
            <intent-filter android:icon="@drawable/icon">
                <action android:name="android.service.wallpaper.WallpaperService" />
            </intent-filter>
            <meta-data android:name="android.service.wallpaper" android:resource="@xml/cube1" />
        </service>
        <activity
            android:label="@string/cube2_settings"
            android:name=".CubeWallpaper1Settings"
            android:icon="@drawable/icon"
            android:exported="true" >
        </activity>
    </application>
</manifest>

My live wallpaper has an Icon, it shows before you install it, but after you install it and you go to Wallpaper>Live Wallpaper, there is no icon in it, it's just an empty gray image.
My live wallpaper has an Icon, it shows before you install it, but after you install it and you go to Wallpaper>Live Wallpaper, there is no icon in it, it's just an empty gray image.

Here is my Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:versionName="1.0" package="com.cutecats.cats" 
    android:versionCode="1">
    <uses-sdk android:minSdkVersion="8" />



    <uses-feature android:name="android.software.live_wallpaper" />
    <application
        android:icon="@drawable/icon" 
        android:label="@string/app_name">
        <service
            android:name=".CubeWallpaper1"
            android:icon="@drawable/icon"
            android:permission="android.permission.BIND_WALLPAPER">
            <intent-filter android:icon="@drawable/icon">
                <action android:name="android.service.wallpaper.WallpaperService" />
            </intent-filter>
            <meta-data android:name="android.service.wallpaper" android:resource="@xml/cube1" />
        </service>
        <activity
            android:label="@string/cube2_settings"
            android:name=".CubeWallpaper1Settings"
            android:icon="@drawable/icon"
            android:exported="true" >
        </activity>
    </application>
</manifest>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

傲娇萝莉攻 2024-12-12 08:02:10

据我了解,动态壁纸的图标有不同类型。每个节目都有自己的时间,您所说的实际上是缩略图,需要放置在

      <wallpaper> 

标签内。
我是这样做的:我使用以下代码创建了 pony.xml 文件:

     <?xml version="1.0" encoding="utf-8"?>
     <wallpaper xmlns:android="http://schemas.android.com/apk/res/android"
        android:thumbnail="@drawable/pony"
        android:description="@string/pony_desc"
     />

在清单文件内我有以下内容:

  <service android:label="@string/pony" android:name="my.pony.wallpaperManagement.SleepyPonyWallpaper"
     android:permission="android.permission.BIND_WALLPAPER">
     <intent-filter>
        <action android:name="android.service.wallpaper.WallpaperService" />
     </intent-filter>
     <meta-data android:name="android.service.wallpaper"
        android:resource="@xml/pony" />
  </service>

请注意对 pony.xml 的引用。

另外,不要忘记将图标设置为适当的尺寸(例如 64x64)。

There are different types of icons for live wallpaper from what i understand. Each shows in its own time, and what you are talking about is actually a thumbnail and needs to be placed inside

      <wallpaper> 

tag.
Here is how i did it: i created pony.xml file with following code:

     <?xml version="1.0" encoding="utf-8"?>
     <wallpaper xmlns:android="http://schemas.android.com/apk/res/android"
        android:thumbnail="@drawable/pony"
        android:description="@string/pony_desc"
     />

Inside manifest file i have following:

  <service android:label="@string/pony" android:name="my.pony.wallpaperManagement.SleepyPonyWallpaper"
     android:permission="android.permission.BIND_WALLPAPER">
     <intent-filter>
        <action android:name="android.service.wallpaper.WallpaperService" />
     </intent-filter>
     <meta-data android:name="android.service.wallpaper"
        android:resource="@xml/pony" />
  </service>

Note the reference to pony.xml.

Also, don't forget to have your icon in appropriate size (e.g. 64x64).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文