Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/205.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何为您的实时壁纸添加图标_Android_Icons_Live_Wallpaper - Fatal编程技术网

Android 如何为您的实时壁纸添加图标

Android 如何为您的实时壁纸添加图标,android,icons,live,wallpaper,Android,Icons,Live,Wallpaper,我的生活壁纸有一个图标,它显示在你安装它之前,但在你安装它,你去壁纸>生活壁纸,没有图标,它只是一个空的灰色图像。 我的生活壁纸有一个图标,它显示在你安装它之前,但在你安装它,你去壁纸>生活壁纸,没有图标,它只是一个空的灰色图像 这是我的舱单: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" a

我的生活壁纸有一个图标,它显示在你安装它之前,但在你安装它,你去壁纸>生活壁纸,没有图标,它只是一个空的灰色图像。 我的生活壁纸有一个图标,它显示在你安装它之前,但在你安装它,你去壁纸>生活壁纸,没有图标,它只是一个空的灰色图像

这是我的舱单:

<?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>

据我所知,现场壁纸有不同类型的图标。每一个都在它自己的时间里出现,而你所说的实际上是一个缩略图,需要放在里面

      <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)

可能太晚了,但如果这对其他人有帮助,请现在告诉我。