Android权限拒绝启动壁纸设置的意图

时间:2015-10-24 03:34:03

标签: android android-intent android-permissions live-wallpaper

不幸的是,当我尝试运行我的壁纸时,我收到一条错误消息,说Permission Denial starting Intent并且需要android.permission.BIND_WALLPAPER,但我似乎无法找出原因。我的清单如下所示:

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

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

    <application
        android:exported="true"
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:permission="android.permission.BIND_WALLPAPER">

        <service
            android:name="WallpaperService"
            android:icon="@drawable/icon"
            android:label="@string/app_name"
            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:name=".WallpaperSetClass"
            android:exported="true"
            android:permission="android.permission.BIND_WALLPAPER"
            android:label="@string/app_name">

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

如果我通过我的手机的动态壁纸部分设置它,动态壁纸确实运行良好,但我想有一个设置区域,以便能够打开我无法打开。 目前我的设置类基本上是空的,只包含onCreate函数和带​​按钮的布局。

我有什么遗失的东西吗?我似乎拥有android:exported

的权限

1 个答案:

答案 0 :(得分:1)

原来我有

android:permission="android.permission.BIND_WALLPAPER"

在错误的位置,它应该在服务标签中,并且只有一个,有多个会破坏它。