2

我无法从“壁纸>配置...”加载动态壁纸首选项。

当我从 Livewallpaper 菜单中单击设置按钮时,首选项加载正常。以下是一些屏幕截图,可以更好地解释错误:

屏幕一

错误日志

清单文件如下:

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

    <uses-sdk android:minSdkVersion="8" />

    <uses-feature android:name="android.software.live_wallpaper" />

    <uses-permission android:name="android.permission.INTERNET" />

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application android:icon="@drawable/icon" android:label="@string/app_name" 
    android:permission="android.permission.BIND_WALLPAPER">
        <service android:name=".LiveWallpaper"
            android:label="@string/app_name"
            android:icon="@drawable/icon">

            <intent-filter>
                <action android:name="android.service.wallpaper.WallpaperService" />
            </intent-filter>
            <meta-data android:name="android.service.wallpaper"
                android:resource="@xml/livewallpaper" />

        </service>

    <activity android:label="PAM_Prefs" android:name=".PAM_Prefs" android:theme="@android:style/Theme.Light.WallpaperSettings" android:exported="true" android:icon="@drawable/icon">
            <uses-permission android:name="android.permission.BIND_WALLPAPER" />    
        </activity>

    </application>

</manifest>
4

1 回答 1

4

在修改清单文件后想通了。添加了一个意图过滤器“category.PREFERENCE”并在服务标签内移动了 BIND_WALLPAPER 权限。这是新的清单文件:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.android.RrD"
  android:versionCode="1"
  android:versionName="1.0">

<uses-sdk android:minSdkVersion="8" />

<uses-feature android:name="android.software.live_wallpaper" />

<uses-permission android:name="android.permission.INTERNET" />

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.BIND_WALLPAPER" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

   <application 
    android:icon="@drawable/icon" 
    android:label="@string/app_name" 
    >

    <service android:name=".LiveWallpaper"
        android:label="@string/app_name"
        android:icon="@drawable/icon"
        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/livewallpaper" />

    </service>

<activity android:label="PAM_Prefs"
        android:name=".PAM_Prefs" 

        android:exported="true" android:icon="@drawable/icon">
         <intent-filter>

            <category android:name="android.intent.category.PREFERENCE" />
        </intent-filter>
    </activity>

</application>
</manifest>
于 2011-04-23T08:21:55.270 回答